SA-MP Forums Archive
[SOLVED]DestroyVehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]DestroyVehicle (/showthread.php?tid=133695)



[SOLVED]DestroyVehicle - XRVX - 13.03.2010

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



Re: DestroyVehicle - Deat_Itself - 13.03.2010

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


Re: DestroyVehicle - XRVX - 13.03.2010

Still doesn't work

The vehicle stay untouched


Re: DestroyVehicle - Joe Staff - 13.03.2010

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)


Re: DestroyVehicle - XRVX - 13.03.2010

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