SA-MP Forums Archive
How can I make a variable that is for all player - 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: How can I make a variable that is for all player (/showthread.php?tid=560795)



How can I make a variable that is for all player - Kruno88 - 30.01.2015

Something like:
If event=1,you can join but It isn't using PlayerInfo but it applies for all players XD


Re: How can I make a variable that is for all player - Vince - 30.01.2015

Create an array with a size of MAX_PLAYERS.


Re: How can I make a variable that is for all player - Kruno88 - 30.01.2015

Umm...Can you post an example?And how to use it XD


Re: How can I make a variable that is for all player - zaibaslr2 - 30.01.2015

pawn Код:
new variable[MAX_PLAYERS];

variable[playerid] = 5;



Re: How can I make a variable that is for all player - Kruno88 - 30.01.2015

Thanx!+REP will get delivered tomorrow!


Re: How can I make a variable that is for all player - MBilal - 30.01.2015

Setting for all players like this

new ForAll[MAX_PLAYERS];

make cmd or where you want to use.

like this.

Код:
CMD:turnon(playerid,params[])
{

	for(new i=0; i < MAX_PLAYERS; i++)
	{
        ForAll[i]=1;
        }

}
CMD:turnoff(playerid,params[])
{

	for(new i=0; i < MAX_PLAYERS; i++)
	{
        ForAll[i]=0;
        }

}

its Just Example hope it help you