This page lists every event SampSharp dispatches from open.mp, organized by category. For an explanation of how to handle events, return value semantics, multiple handlers, custom events, and middleware, see Events.
How to read the tables
Signature — the parameter list your handler can accept. Parameters may be reordered or omitted in your handler; any extra parameter you declare is resolved as a dependency-injected service. See Events for parameter resolution rules.
Returns — the return type. bool events show the default in parentheses (e.g. bool(true)). Returning the default value is equivalent to declaring void; returning the non-default value changes the engine's behavior. See Events for the full return-value semantics, including how multiple handlers compose.
Server & Initialization
Signature
Returns
Description
OnGameModeInit()
void
Server starts.
OnGameModeExit()
void
Server exits or shuts down.
Player Connection
Signature
Returns
Description
OnIncomingConnection(Player, string ipAddress, int port)
Player sent chat. Return false to suppress the message.
OnPlayerCommandText(Player, string text)
bool(false)
Unhandled chat starting with /. Return true if you handled it.
Player Interactions
Signature
Returns
Description
OnPlayerClickMap(Player, Vector3 position)
void
Player clicked the map.
OnPlayerClickPlayer(Player, Player clicked, ClickSource source)
void
Player clicked another player.
Checkpoints
Signature
Returns
Description
OnPlayerEnterCheckpoint(Player)
void
Player entered a checkpoint.
OnPlayerLeaveCheckpoint(Player)
void
Player left a checkpoint.
OnPlayerEnterRaceCheckpoint(Player)
void
Player entered a race checkpoint.
OnPlayerLeaveRaceCheckpoint(Player)
void
Player left a race checkpoint.
Dialogs
Signature
Returns
Description
OnDialogResponse(Player, int dialogId, DialogResponse response, int listItem, string inputText)
void
Player responded to a dialog.
Tip
When using IDialogService, dialog responses are delivered through the service's callback or ShowAsync task — you do not need to handle OnDialogResponse directly. See Dialogs and Menus.
Health & Damage
Signature
Returns
Description
OnPlayerDeath(Player, Player killer, Weapon reason)
void
Player died.
OnPlayerTakeDamage(Player, Player from, float amount, Weapon weapon, BodyPart part)
void
Player took damage.
OnPlayerGiveDamage(Player, Player to, float amount, Weapon weapon, BodyPart part)