onElementDimensionChange
ServerEvent
Fired after an element moves to another dimension. It does not fire when the dimension stays the same.
addEventHandler("onElementDimensionChange", root, function(int oldDimension, int newDimension) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| oldDimension | int | The previous dimension. |
| newDimension | int | The new dimension. |
Source
The element (player, ped, vehicle, object, colshape, sound, effect or element made with createElement) that changed dimension.
Example
addEventHandler("onElementDimensionChange", root, function(oldDimension, newDimension)
if getElementType(source) == "player" then
outputServerLog(getPlayerName(source) .. " went to dimension " .. newDimension)
end
end)