There are a bunch of functions you can use in your .mis file to do code routines at various points. These are reset on mission load and you can override them without causing any conflicts. Here's a list of the callbacks:
[hr]Client Callbacks:
Called when you go out of bounds.
Called when you respawn on the startpad, or a trigger in a hunt match.
Called when you respawn on a checkpoint.
Called when you activate a new checkpoint.
Called when a player joins the server you're on.
Called when a player leaves the server you're on.
Called when the mission finishes loading.
Called right before the mission is unloaded.
Called when the mission resets, this mostly for restarts.
Called when the mission is explicitly restarted (via button or oob).
Called before the end game screen is shown.
Called when a set of gems spawns in a hunt match.
Called every frame, %delta is the frame time in milliseconds.
[hr]Server Callbacks
Called when the mission finishes loading.
Called right before the mission is unloaded.
Called when the mission resets, this mostly for restarts.
Called before the end game screen is shown.
Called when a client on the server goes out of bounds.
Called when a client on the server respawns.
Called every frame, %delta is the frame time in milliseconds.
In general you should use the server callbacks (especially if it's a multiplayer map) for map logic and map-global events. Client callbacks are better for interface updates.
[hr]Client Callbacks:
Code:
function clientCbOnOutOfBounds() {}
Code:
function clientCbOnRespawn() {}
Code:
function clientCbOnRespawnOnCheckpoint() {}
Code:
function clientCbOnActivateCheckpoint() {}
Code:
function clientCbOnPlayerJoin() {}
Code:
function clientCbOnPlayerLeave() {}
Code:
function clientCbOnMissionLoaded() {}
Code:
function clientCbOnMissionEnded() {}
Code:
function clientCbOnMissionReset() {}
Code:
function clientCbOnRestartLevel() {}
Code:
function clientCbOnEndGameSetup() {}
Code:
function clientCbOnHuntGemSpawn() {}
Code:
function clientCbOnFrameAdvance(%delta) {}
[hr]Server Callbacks
Code:
function serverCbOnMissionLoaded() {}
Code:
function serverCbOnMissionEnded() {}
Code:
function serverCbOnMissionReset() {}
Code:
function serverCbOnEndGameSetup() {}
Code:
function serverCbOnOutOfBounds() {}
Code:
function serverCbOnRespawn() {}
Code:
function serverCbOnFrameAdvance(%delta) {}
In general you should use the server callbacks (especially if it's a multiplayer map) for map logic and map-global events. Client callbacks are better for interface updates.
This signature is real code
Code:
function clientcmd12dothepq() {
commandToClient(LocalClientConnection, '34onthedancefloor');
}