OnPlayerTriggerEventThreshold

From Multi Theft Auto: Wiki
Revision as of 13:51, 27 November 2023 by LopSided (talk | contribs) (Created page with "__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22311|This event is triggered when a player exceeds the maximum threshold for events via triggerServerEvent.}} ==Parameters== None ==Source== The source of this event is the player who exceeded the threshold. ===Canceling=== Canceling this event has no effect. ==Example== <syntaxhighlight lang="lua"> function start() setServerConfigSetting("player_triggered_event_inte...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BETA: NEW FEATURE (BUILD: 1.6.0 r22311)
This event is triggered when a player exceeds the maximum threshold for events via triggerServerEvent.

Parameters

None

Source

The source of this event is the player who exceeded the threshold.

Canceling

Canceling this event has no effect.

Example

function start()
    setServerConfigSetting("player_triggered_event_interval", "500") -- set event usage interval to 500ms (default is 1000)
    setServerConfigSetting("max_player_triggered_events_per_interval", "50") -- set max events per interval to 50 (default is 100)
end
addEventHandler("onResourceStart", resourceRoot, start)

function processPlayerTriggerEventThreshold()
    kickPlayer(source, "Event spam")
end
addEventHandler("onPlayerTriggerEventThreshold", root, processPlayerTriggerEventThreshold)

See Also

Player events


Event functions