M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
oldDimensionintThe previous dimension.
newDimensionintThe 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)

See also