Help with car deletion
#1

Hello guys!

I have recently opened a server for A big *******r here in the Netherlands and we made a SAMP server for him. We allow vehicle spawning, but it's getting out of control, how can the vehicles be automatically deleted?

Any help would be appreciated!

-Nick
Reply
#2

You mean DELETED or DE spawned ?!?!?
Reply
#3

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
You mean DELETED or DE spawned ?!?!?
Yeah, I mean de spawn

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Post a code, please.
What kind of code? You mean, from the Spawn Car filterscript?
Reply
#4

Hmmm, You may put a command to re-spawn all unoccupied vehicles for example
Reply
#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
#6

Quote:
Originally Posted by Dizzle
Посмотреть сообщение
Код:
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.
Thanks! I'll test it later today and i'll let you know if it worked!

__EDIT__
Nope does not work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)