SA-MP Forums Archive
RespawnAllCars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: RespawnAllCars (/showthread.php?tid=375614)



RespawnAllCars - C00K13M0N$73R - 07.09.2012

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.


Re: RespawnAllCars - Windrush - 07.09.2012

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


Re: RespawnAllCars - mobiliz - 07.09.2012

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;
}