Quote:
Originally Posted by ]Rafaellos[
Create a loop, check if player is connected (or use foreach) and set his health to 100.
|
i dont think a newbee (as he claimed to be) knows what a loop or even foreach is but i understand that you are trying to make him learn.
@ aCloudy
here is more about loops ;
https://sampwiki.blast.hk/wiki/Loop
if you have a loop like this;
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
basicly your code could look like this;
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
SetPlayerHealth( i , 100);
just put that in a command..you can call it healall or whatever..
SetPlayerHealth has usually playerid..the playerid has been replaced with an 'i' as you can see. The loop makes it possible that ' i ' area playerids threw all players.
you can loop threw alot more ..for example;
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
loops threw all vehicles...see how it works ?