OnVehicleDeath

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:33, 25 November 2010
Kernell (Talk | contribs)
(Added link on Russian version)
← Previous diff
Revision as of 09:44, 23 January 2011
LaZ (Talk | contribs)
(I'd done some testing and the killerid parameter doesn't exit, although it's defined like that in a_samp.inc.)
Next diff →
Line 4: Line 4:
{{Description|This callback is called when a vehicle dies/explodes.}} {{Description|This callback is called when a vehicle dies/explodes.}}
-{{Parameters|vehicleid, killerid}}+{{Parameters|vehicleid}}
{{Param|vehicleid|The ID of the vehicle that 'died'.}} {{Param|vehicleid|The ID of the vehicle that 'died'.}}
-{{Param|killerid|The ID of the player that caused the vehicle to 'die'.}} 
{{NoReturn}} {{NoReturn}}
Line 13: Line 12:
<pawn> <pawn>
-public OnVehicleDeath(vehicleid, killerid)+public OnVehicleDeath(vehicleid)
{ {
new string[40]; new string[40];
- if(killerid == INVALID_PLAYER_ID) format(string, sizeof(string), "Vehicle %i was destroyed.", vehicleid);+ format(string, sizeof(string), "Vehicle %i was destroyed.", vehicleid);
- else format(string, sizeof(string), "Vehicle %i was destroyed by ID %i", vehicleid, killerid);+
SendClientMessageToAll(0xFFFFFFFF, string); SendClientMessageToAll(0xFFFFFFFF, string);
return 1; return 1;

Revision as of 09:44, 23 January 2011


This callback is called when a vehicle dies/explodes.


Parameters:
(vehicleid)
vehicleidThe ID of the vehicle that 'died'.


ReturnsThis function doesn't return a specific value


Image:32px-Ambox_warning_orange.png Note: This callback will also be called when a vehicle enters water


public OnVehicleDeath(vehicleid)
{
    new string[40];
    format(string, sizeof(string), "Vehicle %i was destroyed.", vehicleid);
    SendClientMessageToAll(0xFFFFFFFF, string);
    return 1;
}

Related Callbacks

The following callbacks might be useful as well, as they're related to this callback in one way or another.


Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

Personal tools
In other languages