Quote:
Originally Posted by Clive
pawn Код:
public AutoR() { for(new playerid=0; playerid<MAX_PLAYERS; playerid++) { if(IsPlayerConnected(playerid)) { new Float:health, cid; if (IsPlayerInAnyVehicle(playerid)) { if(IsPlayerAdmin(playerid)) return 0; cid = GetPlayerVehicleID(playerid); GetVehicleHealth(cid, health); if (health < 300) { SetVehicleHealth(cid,1000); GameTextForPlayer(playerid, "Vehicul reparat!",2000,5); } } } } return 1; }
|
if(IsPlayerAdmin(playerid)) return 0;
This stops the function from executing. For example: if player 0 is not admin, then it will not check for other players.
Quote:
Originally Posted by [GF]Sasino97
|
It continues the loop.
For example: Player 0 is not admin, then i write continue; and it continues to player 1 and so on.
Quote:
Originally Posted by Mean
Actually it works that way too!
|
I posted why it doesn't work the way Clive posted.