why doesnt this code work? (reposted because of wrong section) -
Yourfatness - 28.12.2010
this code doesn't seem to do anything:
public OnVehicleDeath(vehicleid, killerid){
SetTimer("DestroyVehicle(vehicleid)",5000,false);
}
i've tried it with and without (vehicleid), yet it still does nothing. the car respawns and this code is useless.
using this code, i am able to get cars to disappear when their health hits 0, unfortuantely this also means that some cars disappear before they explode:
public OnVehicleDeath(vehicleid, killerid){
DestroyVehicle(vehicleid);
}
can anyone help me to make all (or most) cars explode when they are flipped over, but not respawn after?
Re: why doesnt this code work? (reposted because of wrong section) -
WillyP - 28.12.2010
pawn Код:
public OnVehicleDeath(vehicleid, killerid){
SetTimer("DV",2000,false);
return 1;
}
forward DV(vehicleid);
public DV(vehicleid)
{
DestroyVehicle(vehicleid);
}
Re: why doesnt this code work? (reposted because of wrong section) -
Hiddos - 28.12.2010
pawn Код:
forward DV(vehicleid);
public DV(vehicleid)
{
DestroyVehicle(vehicleid);
}
public OnVehicleDeath(vehicleid, killerid)
{
SetTimerEx("DV", 5000, 0 "i", vehicleid);
return 1;
}
Should do the trick.
Re: why doesnt this code work? (reposted because of wrong section) -
Yourfatness - 28.12.2010
thank you Hiddos. you are a badass. it works exactly as it should.
[FU]Victious, maybe you should test the code before posting it. if you had, you would know that it works like my code (it doesnt work).
Re: why doesnt this code work? (reposted because of wrong section) -
_rAped - 28.12.2010
Quote:
Originally Posted by Yourfatness
thank you Hiddos. you are a badass. it works exactly as it should.
[FU]Victious, maybe you should test the code before posting it. if you had, you would know that it works like my code (it doesnt work).
|
Hahaha. Okei you made me laugh by that comment x)
Re: why doesnt this code work? (reposted because of wrong section) -
PowerPC603 - 28.12.2010
You don't need a timer for this.
Just put the DestroyVehicle statement under OnVehicleSpawn.
It won't get destroyed when you create it, but when a vehicle re-spawns (after dying for example).