Respawn Vehicle - Admin Level - Please help
#2

pawn Код:
stock IsVehicleOccupied(vehicleid)
{
    for(new i =0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInVehicle(i,vehicleid))
        {
            return 1;
        }
    }
    return 0;
}

CMD:rv(playerid,params[])
{
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,-4,"{FF9900}Only Admin Level 3 To Use Command!!!");
       
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(!IsVehicleOccupied(i))
        {
            SetVehicleToRespawn(GetPlayerVehicleID(i));
        }
    }
       
    SendClientMessageToAll(0xFFFFFFFF,"{FF0000}Administrator  Respawn Vehicle!!!");
    SendClientMessage(playerid,0xFFFFFFFF,"{FF9900}You Respawn Vehicle!!!!");
    return 1;
}
EDIT 2: My bad, thought you were trying to respawn them if someone was in them, I'll change the code above. UPDATED
Try that code. It will work if the admin level is 3 or above, and will only respawn unoccupied vehicles.
Reply


Messages In This Thread
Respawn Vehicle - Admin Level - Please help - by Miladajir - 06.05.2014, 12:57
Re: Respawn Vehicle - Admin Level - Please help - by Nathan_Taylor - 06.05.2014, 13:02
Re: Respawn Vehicle - Admin Level - Please help - by KillerStrike23 - 06.05.2014, 13:03
Re: Respawn Vehicle - Admin Level - Please help - by Konstantinos - 06.05.2014, 13:14
Re: Respawn Vehicle - Admin Level - Please help - by Miladajir - 06.05.2014, 14:07

Forum Jump:


Users browsing this thread: 1 Guest(s)