onPlayerChangesWorldSpecialProperty | Multi Theft Auto: Wiki Skip to content

onPlayerChangesWorldSpecialProperty

Client-side
Server-side
Shared

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

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

Canceling

This event cannot be cancelled.

Code Examples

server

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