DestroyVehicle on Timer?
#1

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?
Reply
#2

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

[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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)