[HELP]Destroy Vehicle after 5 Seconds - 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: [HELP]Destroy Vehicle after 5 Seconds (
/showthread.php?tid=145412)
[HELP]Destroy Vehicle after 5 Seconds -
eDz0r - 02.05.2010
I need to destroy vehicle after 5 Seconds i Search And I Found SetTimer Fuction But i Dont Know How To U

se
My Code
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 7.0,cardelckp1))
{
PlayerPlaySound(playerid, 1058, 0, 0, 0);
GivePlayerMoney(playerid, 10000);
RemovePlayerFromVehicle(playerid);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~You Completed The Deliver, Well Done!", 3000, 1);
DestroyVehicle(pcar1);//HERE!!!!!!!!!!!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GetVehicleHealth(pcar1, health);
if(health >500)
{
PlayerPlaySound(playerid, 1097, 0, 0, 0);
GameTextForPlayer(playerid, "~y~Great You Deliver It In Perfect Condition Bonus 3000$!", 3000, 3);
GivePlayerMoney(playerid, 3000);
}
}
return 1;
}
Re: [HELP]Destroy Vehicle after 5 Seconds -
RyDeR` - 02.05.2010
Add this instead of DestroyVehicle in ur code.
pawn Код:
SetTimerEx("gDestroyVehicle", 5000, 0, "i", pcar1);
Add this anywhere in ur script..
pawn Код:
forward gDestroyVehicle(vehicleid);
public gDestroyVehicle(vehicleid)
{
return DestroyVehicle(vehicleid);
}
Re: [HELP]Destroy Vehicle after 5 Seconds -
eDz0r - 02.05.2010
Quote:
Originally Posted by » RyDeR «
Add this instead of DestroyVehicle in ur code.
pawn Код:
SetTimerEx("gDestroyVehicle", 5000, 0, "i", pcar1);
Add this anywhere in ur script..
pawn Код:
forward gDestroyVehicle(vehicleid); public gDestroyVehicle(vehicleid) { return DestroyVehicle(vehicleid); }
|
thanks for the help but i solved by myself