Jump to content
Sign in to follow this  
_qor

How to give a variable a value?

Recommended Posts

I want to make kinda kills/deads scoreboard for SP.

Therefore I created two gamelogics whose names should get a value (+1 for each dead).

Something like

gamelogic = 1

Sometimes I want to return these values to display the deads.

So how can I increase the values and how can I return them? I just cant find out...

Would have used addScore but this apparently works only in MP

Edited by _qoR

Share this post


Link to post
Share on other sites

Skip the gamelogics and just initialize the variables in your init.sqf.

mykills = 0;
mydeaths = 0;

Then for each kill/death, you simply run the command

mykill = mykill + 1;

(You'll probably want an eventhandler to do this whenever a kill/death occurs)

You reference the values by just using the variable names. For example, if you want to display the current "score" when triggering a trigger you could use the command

hint format ["Kills: %1 \n Deaths: %2",mykills,mydeaths]; //Would display a hint with the variable values.

Share this post


Link to post
Share on other sites

Exactly what I have been trying, dont know why it didnt work that time.

Thanks! Of course it works...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×