M2O Scripting APIScripting reference
    Preparing search index…
    ModuleClient API

    client-api

    Player

    Client handle for a streamed M2O player.

    Vehicle

    Client handle for a streamed M2O vehicle.

    BoneTransform

    World-space position and orientation resolved from a player bone or vehicle part.

    ChatMessageEvent

    A chat message received from the server.

    CityPartChangeEvent

    A transition between Mafia II city districts.

    EventBus

    Asynchronous resource event bus. Native event names and callback payloads are inferred from EventMap. Script-defined event names remain supported by the string overloads.

    EventMap

    Native events dispatched through Core.Events.on. Each property is the exact callback argument tuple for that event.

    PlayerDamageEvent

    Native damage applied to the local player.

    RadioPowerChangeEvent

    A local vehicle-radio power-state change.

    RadioStationChangeEvent

    A local vehicle-radio station change.

    Bone

    Mafia II default skeleton bone identifiers exported by the M2O client.

    Camera

    Client helpers for projecting world positions through the active game camera.

    Controls

    Controls whether local gameplay input is accepted by the M2O client.

    Events

    Framework event bus for native and resource-defined events.

    Fade

    Controls the game's full-screen scene fader.

    Hud

    Controls visibility of Mafia II's native heads-up display layer.

    LocalPlayer

    The local player, or null while no replicated local entity exists.

    Radio

    Reads and controls the local player's in-car radio. Control is local (not synced to other players) and is rejected while the server has locked the vehicle's radio.

    VehiclePart

    Numeric vehicle-part identifiers exported by the M2O client.

    Window

    Exposes state of the local Mafia II game window.

    World

    Client-side queries against the currently streamed Mafia II world.

    WorldMap

    Client controls for the in-game world map.

    EventName

    Names of native events available in this scripting environment.