OnPlayerChangesWorldSpecialProperty: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add an important note)
(Grammar corrections)
 
Line 2: Line 2:
{{Server event}}
{{Server event}}
{{Important Note|This event is currently not available for use, as there is no new nightly build yet. Please wait patiently and keep an eye on the page for further updates.}}  
{{Important Note|This event is currently not available for use, as there is no new nightly build yet. Please wait patiently and keep an eye on the page for further updates.}}  
{{Added feature/item|1.6.1|1.6.0|0|This event is triggered every a [[player]] calls setWorldSpecialPropertyEnabled.}}
{{Added feature/item|1.6.1|1.6.0|0|This event is triggered every time a [[player]] calls [[setWorldSpecialPropertyEnabled]].}}
==Parameters==
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Latest revision as of 19:54, 27 November 2024

[[{{{image}}}|link=|]] Important Note: This event is currently not available for use, as there is no new nightly build yet. Please wait patiently and keep an eye on the page for further updates.
BETA: NEW FEATURE (BUILD: 1.6.0 r0)
This event is triggered every time a player calls setWorldSpecialPropertyEnabled.

Parameters

string property, bool enabled
  • property: The name of the property
  • enabled: The property's state

Source

The source of this event is the player who changed a special property.

Canceling

This event cannot be cancelled.

Example

The example below bans the player if a cheat is activated

local cheats = {
    ["hovercars"] = true,
    ["aircars"] = true,
    ["extrabunny"] = true,
    ["extrajump"] = true
}

addEventHandler("onPlayerChangesWorldSpecialProperty", root,
    function(property, enabled)
        if not cheats[property] then
            return
        end

        if not enabled then
            return
        end

        banPlayer(source, false, false, true, "Server", "Time to take a permanent break :-)")
    end
)

See Also

Player events


Event functions