SA-MP Forums Archive
OnVehicleDeath doesn't get called(?) - 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)
+--- Thread: OnVehicleDeath doesn't get called(?) (/showthread.php?tid=556717)



OnVehicleDeath doesn't get called(?) - PaulDinam - 11.01.2015

So i've been struggling to know what reason behind this.. it just doesn't get called whenever a vehicle is destroyed!

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    SendClientMessageToAll(0xFFFFFFFF, "Vehicle destroyed.");
    return 1;
}



Re: OnVehicleDeath doesn't get called(?) - Ironboy - 11.01.2015

pawn Код:
new string[40];
format(string, sizeof(string), "Vehicle %i was destroyed.", vehicleid);
SendClientMessageToAll(0xFFFFFFFF, string);



Re: OnVehicleDeath doesn't get called(?) - PaulDinam - 11.01.2015

Why do you think that'll make a difference, I merely wrote 1 line of code to send a message to everyone and it still doesn't work. I've even tested it on a blank gamemode and OnVehicleDeath as well as OnVehicleSpawn are not called.


Re: OnVehicleDeath doesn't get called(?) - Ironboy - 11.01.2015

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
Why do you think that'll make a difference, I merely wrote 1 line of code to send a message to everyone and it still doesn't work. I've even tested it on a blank gamemode and OnVehicleDeath as well as OnVehicleSpawn are not called.
This function normally works, you might be having some glitches in the code. I've given the above code because if one way doesn't work then you gotta go for another one.


Re: OnVehicleDeath doesn't get called(?) - PaulDinam - 11.01.2015

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
This function normally works, you might be having some glitches in the code. I've given the above code because if one way doesn't work then you gotta go for another one.
A blank gamemode shouldn't have any glitches in it..


Re: OnVehicleDeath doesn't get called(?) - Ironboy - 11.01.2015

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
A blank gamemode shouldn't have any glitches in it..
Its weird that it doesn't work for you, i've even tested it and works perfectly.


Re: OnVehicleDeath doesn't get called(?) - PaulDinam - 11.01.2015

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Its weird that it doesn't work for you, i've even tested it and works perfectly.
Okay I just found out that the callback won't get called if the vehicle gets flipped by itself so the callback itself works perfectly fine. That was my issue.. and no longer an issue.