M MY Multiplayer: Wiki
Side
Kind

onElementInteriorChange

ServerEvent

Fired after an element moves to another interior. It does not fire when the interior stays the same.

addEventHandler("onElementInteriorChange", root, function(int oldInterior, int newInterior) … end)

Handler parameters

NameTypeDescription
oldInteriorintThe previous interior.
newInteriorintThe new interior.

Source

The element (player, ped, vehicle, object or sound) that changed interior.

Example

addEventHandler("onElementInteriorChange", root, function(oldInterior, newInterior)
    if getElementType(source) == "player" and newInterior ~= 0 then
        setElementDimension(source, 0)
    end
end)

See also