SA-MP Forums Archive
[Pedido] lc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] lc (/showthread.php?tid=513569)



lc - yoki - 17.05.2014

ola meu comando /lc esta funfando mais nao reseta os carros sem uso reseta todos ate o que os player estao usando sera que alguem tem um ai que reseta so sem uso


Re: lc - MultiKill - 17.05.2014

pawn Код:
stock IsVehicleOccupied(vehicleid)
{
    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) == vehicleid)
                {
                    return 1;
                }
            }
        }
    }
    return 0;
}
pawn Код:
if(strcmp(cmd, "/rvu", true) == 0)
    {
        if(IsPlayerAdmin(playerid)
        {
            for(new v = 0; v < MAX_VEHICLES; v++)
            {
                if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);
            }

        }
        return 1;
    }