[Ajuda] Respawn Carro
#2

Quote:
Originally Posted by PT
Посмотреть сообщение
Olб

Tenta usar o comando assim;

pawn Код:
if(strcmp(cmd, "/rv", true) == 0)
{
    new ptname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, ptname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, ptname);
    if(pAdmin[playerid] > 0)
    {
        for(new v = 0; v < MAX_VEHICLES; v++)
        {
            if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
        }
        SendClientMessage(playerid, Verde, "Veнculos desocupados respawnados!");
        format(string, sizeof(string), "O(A) ADM %s (%d) respawnou todos os veнculos desocupados.", ptname, playerid);
        SendClientMessageToAll(tcadm, string);
    }
    return 1;
}
E a stock assim;

pawn Код:
stock IsVehicleOccupied(vid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerState(i) == PLAYER_STATE_DRIVER || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
            {
                if(GetPlayerVehicleID(i) == vid)
                {
                    return 1;
                }
            }
        }
    }
    return 0;
}

PT
Ja respondi lб
Reply


Messages In This Thread
Respawn Carro - by Tenhos - 24.04.2013, 13:23
Re: Respawn Carro - by PT - 24.04.2013, 13:32
Re: Respawn Carro - by Tenhos - 24.04.2013, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)