Car go boom~!? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car go boom~!? (
/showthread.php?tid=152856)
Car go boom~!? -
Antonio [G-RP] - 06.06.2010
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;
}
Re: Car go boom~!? -
[HiC]TheKiller - 06.06.2010
Ofcource the car will explode. What are you actually trying to do?
Re: Car go boom~!? -
Antonio [G-RP] - 06.06.2010
It just doesn't work. In-game, it doesnt freeze your OR shut the engine off.
Re: Car go boom~!? -
Bcklup - 06.06.2010
WTH does vEngine do anyway?
Re: Car go boom~!? -
Antonio [G-RP] - 06.06.2010
Thats the vehicles engine..
Re: Car go boom~!? -
[HiC]TheKiller - 06.06.2010
You cant really stop a car blowing up unless you continuously set the health of the car higher.
Re: Car go boom~!? -
Antonio [G-RP] - 06.06.2010
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); ..
Re: Car go boom~!? -
llama - 06.06.2010
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.
Re: Car go boom~!? -
Antonio [G-RP] - 06.06.2010
Hmm.. it isnt working

Am I supposed to run a timer or something on this function?
Re: Car go boom~!? -
llama - 06.06.2010
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?