Help with car deletion
#5

Код:
CMD:respawnallveh(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
		SendClientMessage(playerid, -1, "All unoccupied vehicles were respawned!");
		}
		for(new cars=0; cars<MAX_VEHICLES; cars++)
		{
			if(!VehicleOccupied(cars))
			{
				SetVehicleToRespawn(cars);
			}
		}
		return 1;
	}
And at the bottom of your script -

Код:
stock IsVehicleOccupied(vehicleid)
{
    for (new i = 0; i < GetMaxPlayers(); i ++)
    {
        if (GetPlayerVehicleID(playerid) == vehicleid) return true;
    }
    return false;
}
Untested.
Reply


Messages In This Thread
Help with car deletion - by nickbouwhuis - 01.10.2012, 18:33
Re: Help with car deletion - by Red_Dragon. - 01.10.2012, 18:56
Re: Help with car deletion - by nickbouwhuis - 01.10.2012, 19:30
Re: Help with car deletion - by Red_Dragon. - 01.10.2012, 19:50
Re: Help with car deletion - by Dizzle - 01.10.2012, 20:39
Re: Help with car deletion - by nickbouwhuis - 02.10.2012, 08:13

Forum Jump:


Users browsing this thread: 1 Guest(s)