How to make a loop to add playerid? - 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 to make a loop to add playerid? (
/showthread.php?tid=636600)
How to make a loop to add playerid? -
Romero837 - 30.06.2017
How could I make a loop or some other way to use playerid in CallBacks that have no playerid in their structure?
Re: How to make a loop to add playerid? -
Whatname - 30.06.2017
PHP код:
public CB()
{
for(new i = 0; i < GetMaxPlayers();i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue; //skip if player is not connected or npc
SetPlayerHealth(i, 100.0); //example set player health to 100
}
return 1;
}