Wow, thanks alot mate! Amazing.
But will this work for MP?
Won't I need to use Public variables.
It seems to me, who is a complete newbie on this, that this will only
execute itself on the local machine.
Would it be enough to do this?
player removeAllEventHandlers "Killed"
tx_deaths = tx_deaths + 1
PublicVariable "tx_deaths"
@alive player
player addEventHandler ["killed", {_this exec "myrespawn.sqs"}]
exit
Am I out of line?
Thank you so much again, for your help.
if you public variable tx_deaths, then all computers will have the same value for tx_deaths.
I took it that you wanted the number of times a player was killed to be incremented, so that each player would get different messages.
In your system if:
Player A dies 3 times. tx_deaths = 3
However if Player B is the last player to die, but he only dies once, then tx_deaths = 1
Public variable this value and it overwrites all previous values for this variable
thew only think you would need to PV is perhaps a boolean in a script that you would use to run the outro.sqs
*********************************************************
Variables_myvariableThis is a local variable, which means it is only used by a script when the script is running. When the script exits, this variable is deleted from memory
myvariableThis is a global variable. It is always resident in memory and can be called for by any script at any time. The value for this variable is only known on the computer that is using it
myvariable; Publicvariable "myvariable"This is a public variable.
What it actually is, is a global variable, who's value you want to transmit to all other computers, which will overwrite their stored value
The questions you need to ask when scripting are
1) Does i want to use this value outside this script
answer = NO, use a local variable
answer = YES, use a global variable
2) Having decided that i need to call on a variable from more than one script and therefore i need a global variable:
Do other computers need to know this value
answer = No, stick with global
answer = yes, transmit the global variable, using the publicvariable command, when other machines need to know it.
I hope i didnt go over the top with my explanation