SA-MP Forums Archive
DestroyVehicle on Timer? - 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)
+--- Thread: DestroyVehicle on Timer? (/showthread.php?tid=477617)



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 Floatx,Floaty,Floatz;
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.