DestroyVehicle on Timer? -
DJ_Shocker - 25.11.2013
Have a question for those that have accomplished this.
Basically, if a vehicle's health reaches the point of catching fire, i'd like for the "explosion" to still happen and after it does, for the DestroyVehicle(car[killerid]); to happen. So basically, set a little timer for it.
So basically, OnVehicleDeath is just doing:
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
DestroyVehicle(car[killerid]);
return 1;
}
So how would i put SetTimerEx into the DestroyVehicle?
Re: DestroyVehicle on Timer? -
DobbysGamertag - 25.11.2013
Just add vehicle id as a parameter.
Edit, i explained shit;
pawn Код:
//where you need it
SetTimerEx("DestroyCar", 5000, false, "d", vehicleid);
//wherever you like.
forward public DestroyCar(vehicleid);
public DestroyCar(vehicleid)
{
//code
return 1;
}
Re: DestroyVehicle on Timer? -
DJ_Shocker - 25.11.2013
[PAWN]
public OnVehicleDeath(vehicleid, killerid)
{
new Float
![Tongue](images/smilies/razz.gif)
x,Float
![Tongue](images/smilies/razz.gif)
y,Float
![Tongue](images/smilies/razz.gif)
z;
GetVehiclePos(vehicleid,px,py,pz);
CreateExplosion(px+0.5,py,pz,0,10);
CreateExplosion(px,py-0.5,pz,0,10);
CreateExplosion(px-0.5,py,pz,0,10);
CreateExplosion(px,py+0.5,pz,0,10);
DestroyVehicle(car[killerid]);
return 1;
}
This is not creating the explosions. No one can see them, just the player dying.