i want to use this command only for admin....
#10

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
Посмотреть сообщение
What does the
pawn Код:
continue;
function?
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)