OnVehicleExplode: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
|||
Line 10: | Line 10: | ||
==Example== | ==Example== | ||
This example | This example tells the players when a vehicle explodes | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function onVehicleExplode () --The function in which when a vehicle explodes | ||
local VagosVehicleHealth = getVehicleHealth ( VagosVehicle ) --Gets the HP of the Vagos' vehicle | |||
-- | |||
if ( VagosVehicleHealth == 0 ) then --If the vehicle's health is "0" (exploded) | |||
showTextForAll ( 3000, 0, 10, 125, 1.5, " VAGOS' LOAD HAS EXPLODED!" ) --shows the text | |||
end | |||
addEventHandler ( "onVehicleExplode", root, onVehicleExplode ) --Event is triggered | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 20:48, 3 July 2007
This event is triggered when a vehicle explodes.
Syntax
void onVehicleExplode ()
Example
This example tells the players when a vehicle explodes
function onVehicleExplode () --The function in which when a vehicle explodes local VagosVehicleHealth = getVehicleHealth ( VagosVehicle ) --Gets the HP of the Vagos' vehicle if ( VagosVehicleHealth == 0 ) then --If the vehicle's health is "0" (exploded) showTextForAll ( 3000, 0, 10, 125, 1.5, " VAGOS' LOAD HAS EXPLODED!" ) --shows the text end addEventHandler ( "onVehicleExplode", root, onVehicleExplode ) --Event is triggered