RespawnAllCars
#1

pawn Код:
dcmd_rac(playerid,params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
            if(!IsVehicleOccupied(i)) return 0;
            SetVehicleToRespawn(i);
        }
    }
    return 1;
}
My IsVehicleOccupied stock
pawn Код:
stock IsVehicleOccupied(vehicleid)
{
    for(new i =0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInVehicle(i,vehicleid))
        {
            return 1;
        }
    }
    return 0;
}
It returns 0 ingame. Any assistance please?

**Compiles fine.
Reply
#2

pawn Код:
CMD:rac(playerid,params[]) {
    #pragma unused params
    if(AccInfo[playerid][Level] >=4) {
        Inter_SendClientMessage(playerid,COLOR_WHITE," All empty cars were respawned !");
        for(new v=0;v<MAX_VEHICLES;v++) if(!IsVehicleOccupied(v)) EraseVeh(v);
    }
    else
    {
        Inter_SendClientMessage(playerid,COLOR_RED,"Must be Admin Level 4 to reset all of the vehicles.");
        return 1;
    }
    return 1;
}

try this
use ZCMD
Reply
#3

Just try
pawn Код:
dcmd_rac(playerid, params[])
{
        if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
        {
        SetAllVehiclesToRespawn();
        SendClientMessageToAll(COLOR_WHITE,"All vehicles have been respawned.");
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)