[SOLVED]DestroyVehicle
#1

Hey, Why it doesn't remove an players vehicle after 3 secs?
Code:

Код:
forward VehRemove(playerid);
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	SetTimer("VehRemove",3000,false);
	return 1;
}
Код:
public VehRemove(playerid)
{
	new cardes;
	cardes = GetPlayerVehicleID(playerid);
	DestroyVehicle(cardes);
}
Reply
#2

Код:
	new cardes;
	cardes = GetPlayerVehicleID(playerid);
put that both at the top of your script then it may work
Reply
#3

Still doesn't work

The vehicle stay untouched
Reply
#4

You need to use SetTimerEx, so that you can pass that vehicle's ID (NOT the playerid, because the player won't be in a vehicle anymore, thus can't destroy it)
Reply
#5

Quote:
Originally Posted by Joe Staff
You need to use SetTimerEx, so that you can pass that vehicle's ID (NOT the playerid, because the player won't be in a vehicle anymore, thus can't destroy it)
Thanks, everything works fine now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)