Is it possible?
#1

I created some vehicles with the CreateVehicle command and they respawn. That's good. Now, if a player leaves a vehicle, i want the vehicle to be deleted after 15 seconds. Is it possible
Reply
#2

ofc,
pawn Код:
CreateVehicle(458,2076.7231,1656.9888,10.6719,177.5046,0,0,(Time how long to respawn);
Example:
pawn Код:
CreateVehicle(458,2076.7231,1656.9888,10.6719,177.5046,0,0,-1); // -1 means that it wont respawn change it to set respawn time.
Or you mean that you wanna delete it complitly?
Reply
#3

Yes, but it's impossible to set it to 15 secs. You can set a timer: 15 seconds after player exits vehicle, and if he isn't there after 15 sec, DestroyVehicle.
Reply
#4

pawn Код:
public OnPlayerExitVehicle( playerid, vehicleid )
{
    SetTimerEx( "PlsDeleteVehicle", 15000, 0, "d", vehicleid );
    return true;
}

forward PlsDeleteVehicle( vehicleid );
public PlsDeleteVehicle( vehicleid )
{
    DestroyVehicle( vehicleid );
    return true;
}
That's just a basic example, use

https://sampwiki.blast.hk/wiki/OnPlayerExitVehicle

for more info.
Reply
#5

That's just what i needed, Thanks!
Reply
#6

pawn Код:
CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 15);//last param respawn time in seconds.
That will respawn after 15seconds (without a driver) no need for timers.

Just noticed you wanted it deleting sorry.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)