OnClientPedVehicleExit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client event}} __NOTOC__ {{New feature/item|3.0160|1.5.8|20740|This event is fired when a ped has exited a vehicle.}} ==Parameters== <syntaxhighlight lang="lua">...")
 
Line 14: Line 14:


==Example==  
==Example==  
{{Needs Example}}
This example will immediately blow any vehicle a ped exits if the vehicle's health is below 500.
<syntaxhighlight lang="lua">
function blowVehicleOnExit(theVehicle, seat)
    local vehHealth = getElementHealth(theVehicle)
    if (vehHealth < 500) then
        blowVehicle(theVehicle)
    end
end
addEventHandler("onClientPedVehicleExit", root, blowVehicleOnExit)
</syntaxhighlight>


==See Also==
==See Also==

Revision as of 20:18, 8 December 2020

This event is fired when a ped has exited a vehicle.

Parameters

vehicle theVehicle, int seat
  • theVehicle: the vehicle that the ped exited.
  • seat: the number of the seat that the ped was sitting on.

Source

The source of this event is the ped that exited the vehicle.

Example

This example will immediately blow any vehicle a ped exits if the vehicle's health is below 500.

function blowVehicleOnExit(theVehicle, seat)
    local vehHealth = getElementHealth(theVehicle)
    if (vehHealth < 500) then
        blowVehicle(theVehicle)
    end
end
addEventHandler("onClientPedVehicleExit", root, blowVehicleOnExit)

See Also

Client ped events


Client ped functions