Fork me on GitHub

Documentation for the Maniaplanet game operating system

Callbacks

This is a list of the script callbacks implemented into the official Nadeo modes.

To use this callbacks you must set S_UseScriptCallbacks in the server settings to true (it's at false by default).

They all use ManiaPlanet.ModeScriptCallbackArray(string Param1, string Params[]); callback. Param1 is the name of the callback and Params is an array containing the data.

The only exception is Elite that has some very specific callbacks.

Common

LibXmlRpc_BeginMatch

LibXmlRpc_LoadingMap

LibXmlRpc_BeginMap

LibXmlRpc_BeginSubmatch

LibXmlRpc_BeginRound

LibXmlRpc_BeginTurn

LibXmlRpc_BeginPlaying

LibXmlRpc_EndPlaying

LibXmlRpc_EndTurn

LibXmlRpc_EndRound

LibXmlRpc_EndSubmatch

LibXmlRpc_EndMap

LibXmlRpc_UnloadingMap

LibXmlRpc_EndMatch

LibXmlRpc_BeginPodium

LibXmlRpc_EndPodium

LibXmlRpc_BeginWarmUp

LibXmlRpc_EndWarmUp

ShootMania

Common

LibXmlRpc_Rankings

LibXmlRpc_Scores

LibXmlRpc_PlayerRanking

WarmUp_Status

LibAFK_IsAFK

LibAFK_Properties

Mode dependent

To avoid to spam XmlRpc these events are sent only if it has an interest for the mode

LibXmlRpc_OnShoot

LibXmlRpc_OnHit

LibXmlRpc_OnNearMiss

LibXmlRpc_OnArmorEmpty

LibXmlRpc_OnCapture

LibXmlRpc_OnPlayerRequestRespawn

Royal

Royal_UpdatePoints

Royal_SpawnPlayer

Time attack

TimeAttack_OnStart

TimeAttack_OnCheckpoint

TimeAttack_OnFinish

TimeAttack_OnRestart

Joust

Joust_OnReload

Joust_SelectedPlayers

Joust_RoundResult

Elite

Elite is a bit special as it uses an older callback function and JSON encoding. ManiaPlanet.ModeScriptCallback(string Param1, string Param2); Param1 is the name of the callback and Param2 contains the data.

The generic callbacks listed above are also sent in Elite. So if you want to turn off the JSON ones you can change the setting S_UseLegacyCallback to False (it's at True by default).

BeginMatch

{
    "Timestamp": 8907890,
    "MatchNumber": 1,
    "Restart": false
}

BeginMap

{
    "Timestamp": 8910190,
    "MapNumber": 1,
    "Restart": false
}

BeginSubmatch

{
    "Timestamp": 8910190,
    "SubmatchNumber": 1
}

BeginTurn

{
    "Timestamp": 2793470,
    "TurnNumber": 2,
    "StartTime": 2796470,
    "EndTime": 2856470,
    "PoleTime": 2841470,
    "AttackingClan": 2,
    "DefendingClan": 1,
    "AttackingPlayer": {
        "Login": "eole2",
        "Name": "$aafV².$fffAessi",
        "CurrentClan": 2,
        "Armor": 300,
        "ArmorMax": 300,
        "IsTouchingGround": false,
        "IsCapturing": false,
        "IsInOffZone": false,
        "Score": {
            "AtkPoints": 0,
            "DefPoints": 3,
            "GoalAverage": 2
        }
    },
    "DefendingPlayers": [
        {
            "Login": "eole",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test2",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test3",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        }
    ]
}

OnCapture

{
    "Timestamp": 1329230,
    "StartTime": 1279720,
    "EndTime": 1339720,
    "PoleTime": 1324720,
    "Event": {
        "Type": "EType::OnCapture",
        "Damage": 0,
        "WeaponNum": 0,
        "MissDist": 0,
        "Player": {
            "Login": "eole2",
            "Name": "$aafV².$fffAessi",
            "CurrentClan": 2,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": true,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": -3
            }
        },
        "Pole": {
            "Tag": "Goal A",
            "Order": 0,
            "Captured": false
        }
    }
}

OnHit

{
    "Timestamp": 161900,
    "StartTime": 156830,
    "EndTime": 216830,
    "PoleTime": 201830,
    "Event": {
        "Type": "EType::OnHit",
        "Damage": 100,
        "WeaponNum": 1,
        "MissDist": 0,
        "HitDist": 2.34118,
        "Shooter": {
            "Login": "eole2",
            "Name": "$aafV².$fffAessi",
            "CurrentClan": 2,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 1,
                "GoalAverage": 0
            },
            "Position": [45.65, 1.267, 6.498]
        },
        "Victim": {
            "Login": "eole",
            "Name": "$i$888b$fff`$888Side.$fffEole",
            "CurrentClan": 1,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": -2
            },
            "Position": [68.167495, 45.423, 6.19]
        }
    }
}

OnArmorEmpty

{
    "Timestamp": 10117060,
    "StartTime": 10080830,
    "EndTime": 10140830,
    "PoleTime": 10125830,
    "Event": {
        "Type": "EType::OnArmorEmpty",
        "Damage": 0,
        "WeaponNum": 0,
        "MissDist": 0,
        "Shooter": {
            "Login": "eole2",
            "Name": "$aafV².$fffAessi",
            "CurrentClan": 2,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": true,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": 0
            },
            "Position": [145.12, 10.2654, 0.144]
        },
        "Victim": {
            "Login": "eole",
            "Name": "$i$888b$fff`$888Side.$fffEole",
            "CurrentClan": 1,
            "Armor": 0,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": true,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": -1
            },
            "Position": [95.45, 58.65, 9.157]
        }
    }
}

OnPlayerRequestRespawn

{
    "Timestamp": 142460,
    "StartTime": 100460,
    "EndTime": 160460,
    "PoleTime": 145460,
    "Event": {
        "Type": "EType::OnPlayerRequestRespawn",
        "Damage": 0,
        "WeaponNum": 0,
        "MissDist": 0,
        "Player": {
            "Login": "eole",
            "Name": "$i$888b$fff`$888Side.$fffEole",
            "CurrentClan": 1,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": 0
            }
        }
    }
}

OnShoot

{
    "Timestamp": 1784110,
    "StartTime": 1778750,
    "EndTime": 1838750,
    "PoleTime": 1823750,
    "Event": {
        "Type": "EType::OnShoot",
        "Damage": 0,
        "WeaponNum": 1,
        "MissDist": 0,
        "Shooter": {
            "Login": "eole2",
            "Name": "$aafV².$fffAessi",
            "CurrentClan": 2,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": 0
            },
            "Position": [193.142, 0.995464, 159.373]
        }
    }
}

OnNearMiss

{
    "Timestamp": 710280,
    "StartTime": 702670,
    "EndTime": 762670,
    "PoleTime": 747670,
    "Event": {
        "Type": "EType::OnNearMiss",
        "Damage": 0,
        "WeaponNum": 0,
        "MissDist": 0.0256433,
        "Shooter": {
            "Login": "eole",
            "Name": "$i$888b$fff`$888Side.$fffEole",
            "CurrentClan": 1,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": 0
            }
        },
        "Victim": {
            "Login": "eole2",
            "Name": "$aafV².$fffAessi",
            "CurrentClan": 2,
            "Armor": 100,
            "ArmorMax": 100,
            "IsTouchingGround": true,
            "IsCapturing": false,
            "IsInOffZone": false,
            "Score": {
                "AtkPoints": 0,
                "DefPoints": 0,
                "GoalAverage": 0
            }
        }
    }
}

EndTurn

{
    "Timestamp": 6909440,
    "TurnNumber": 1,
    "StartTime": 6903090,
    "EndTime": 6909440,
    "PoleTime": 6894440,
    "AttackingClan": 2,
    "DefendingClan": 1,
    "AttackingPlayer": {
        "Login": "eole2",
        "Name": "$aafV².$fffAessi",
        "CurrentClan": 2,
        "Armor": 100,
        "ArmorMax": 100,
        "IsTouchingGround": false,
        "IsCapturing": false,
        "IsInOffZone": false,
        "Score": {
            "AtkPoints": 1,
            "DefPoints": 0,
            "GoalAverage": 3
        }
    },
    "TurnWinnerClan": 2,
    "WinType": "DefenseEliminated",
    "Clan1RoundScore": 0,
    "Clan2RoundScore": 1,
    "Clan1MapScore": 0,
    "Clan2MapScore": 0,
    "ScoresTable": [
        {
            "Login": "eole",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test1",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test2",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "eole2",
            "CurrentClan": 2,
            "AtkPoints": 1,
            "DefPoints": 0
        },
        {
            "Login": "test3",
            "CurrentClan": 2,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test4",
            "CurrentClan": 2,
            "AtkPoints": 0,
            "DefPoints": 0
        }
    ]
}

EndSubmatch

{
    "Timestamp": 7699950,
    "SubmatchNumber": 1
}

EndMap

{
    "Timestamp": 7699950,
    "MapNumber": 1,
    "MapWinnerClan": 2,
    "Clan1MapScore": 0,
    "Clan2MapScore": 0,
    "ScoresTable": [
        {
            "Login": "eole",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test1",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test2",
            "CurrentClan": 1,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "eole2",
            "CurrentClan": 2,
            "AtkPoints": 1,
            "DefPoints": 0
        },
        {
            "Login": "test3",
            "CurrentClan": 2,
            "AtkPoints": 0,
            "DefPoints": 0
        },
        {
            "Login": "test4",
            "CurrentClan": 2,
            "AtkPoints": 0,
            "DefPoints": 0
        }
    ]
}

EndMatch

{
    "Timestamp": 8380990,
    "MatchNumber": 1,
    "MatchWinnerClan": 1,
    "Clan1MapScore": 1,
    "Clan2MapScore": 0
}

BeginWarmup

{
    "Timestamp": 8911200,
    "AllReady": false
}

EndWarmup

{
    "Timestamp": 8925780,
    "AllReady": true
}

MatchmakingGetOrder

TrackMania

Common

LibXmlRpc_OnStartCountdown

LibXmlRpc_OnStartLine

LibXmlRpc_OnWayPoint

LibXmlRpc_OnGiveUp

LibXmlRpc_OnRespawn

LibXmlRpc_OnStunt

LibXmlRpc_PlayerRanking

LibXmlRpc_PlayersRanking

LibXmlRpc_PlayersScores

LibXmlRpc_PlayersTimes

LibXmlRpc_TeamsScores

LibXmlRpc_TeamsMode

LibXmlRpc_WarmUp

Rounds / Cup

Rounds_PointsRepartition

Methods

You can also trigger some events in the game mode script by using TriggerModeScriptEvent(String1, String2); or TriggerModeScriptEventArray(string, array);.

Common

LibXmlRpc_GetPlayerRanking

ShootMania

Common

LibXmlRpc_DisableAltMenu

LibXmlRpc_EnableAltMenu

LibXmlRpc_GetRankings

LibXmlRpc_GetScores

WarmUp_Extend

WarmUp_Stop

WarmUp_GetStatus

LibScoresTable2_SetStyleFromXml

LibAFK_SetProperties

LibAFK_GetProperties

Matchmaking

Matchmaking_Start

Matchmaking_Stop

Matchmaking_Force

Combo

Combo_SetTimersLayerPosition

Elite

MatchmakingSetOrder

Siege

Siege_SetProgressionLayerPosition

Lobby

LibXmlRpc_Lobby_SetRoundDuration

TrackMania

Common

LibXmlRpc_GetPlayersScores

LibXmlRpc_GetPlayersTimes

LibXmlRpc_GetTeamsScores

LibXmlRpc_GetTeamsMode

LibXmlRpc_GetWarmUp

LibXmlRpc_GetPlayersRanking

LibXmlRpc_SetPlayersScores

LibXmlRpc_SetTeamsScores

Rounds / Cup / Team

Rounds_SetPointsRepartition

Rounds_GetPointsRepartition

Rounds_ForceEndRound

UI_DisplaySmallScoresTable