why doesnt this code work? (reposted because of wrong section)
#1

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

pawn Код:
public OnVehicleDeath(vehicleid, killerid){
SetTimer("DV",2000,false);
return 1;
}

forward DV(vehicleid);
public DV(vehicleid)
{
DestroyVehicle(vehicleid);
}
Reply
#3

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.
Reply
#4

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).
Reply
#5

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)
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)