Replace the variables to 0 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Replace the variables to 0 (
/showthread.php?tid=528784)
Replace the variables to 0 -
Baltimore - 29.07.2014
Hello.
So now I have several variables like:
test1[playerid];
This variable will take a value, for example:
test1[playerid] = 1;
So I have put this variable to 0 when the player disconnects because another will take the same id and I do not want him to have this variable to 1.
I also have various tables with values that give it:
PlayerInfo[playerid][Level];
The variable table will also have a value, and therefore I will have to disconnect it again to 0.
But hey, it's pretty boring, is there a way to reset it to zero?
At least for the tables?
THX
Re: Replace the variables to 0 -
Blademaster680 - 29.07.2014
At the top of your script were it says "new test1[MAX_PLAYERS];" Set it to "new test1[MAX_PLAYERS] = 0;
Re: Replace the variables to 0 -
Baltimore - 29.07.2014
Not because it is the launch of the script, if I do that anyway and that test1 is 1 to id 0 and the player disconnects and reconnects to another player id 0 variable will still be equal to 1 ...
Re: Replace the variables to 0 -
Isolated - 29.07.2014
pawn Код:
//OnPlayerDisconnect
test1[playerid] = 0;
Re: Replace the variables to 0 -
youssefehab500 - 29.07.2014
Quote:
Originally Posted by Baltimore
Not because it is the launch of the script, if I do that anyway and that test1 is 1 to id 0 and the player disconnects and reconnects to another player id 0 variable will still be equal to 1 ...
|
show us the part which sets test1 to 1 under onplayerconnect and disconnect and the new test1 show all