[HELP]Destroy Vehicle after 5 Seconds
#1

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

Reply
#2

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);
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)