Car go boom~!?
#1

For some reason, this code doesn't work

Help please?

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new Float:vHP;
    GetVehicleHealth(vehicleid, vHP);
    if(vHP < 300)
    {
      vEngine[vehicleid] = 0;
      TogglePlayerControllable(playerid, 0);
      return 1;
    }
    return 1;
}
Reply
#2

Ofcource the car will explode. What are you actually trying to do?
Reply
#3

It just doesn't work. In-game, it doesnt freeze your OR shut the engine off.
Reply
#4

WTH does vEngine do anyway?
Reply
#5

Thats the vehicles engine..
Reply
#6

You cant really stop a car blowing up unless you continuously set the health of the car higher.
Reply
#7

Im not trying to stop the vehicle from blowing up, im trying to get the damn thing to work! It wont even TogglePlayerControllable(playerid, 0); ..

Reply
#8

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
  printf("Vehicle ID: %d damaged by player: %d", vehicleid, playerid);
  return 1;
}
Try this to see if it's correctly passing your playerid through the callback.
Reply
#9

Hmm.. it isnt working Am I supposed to run a timer or something on this function?
Reply
#10

Perhaps the OnVehicleDamageStatusUpdate callback is only called for when a player is attacking a car, or when one of the components gets damaged (Tires, Doors, etc), or maybe even when you use the UpdateVehicleDamageStatus function?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)