IsWorldSpecialPropertyEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added to server-side)
(Removed really weird and nonsense example)
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:


==Example==
==Example==
<section name="Clientside example" class="client" show="true">
{{Needs Example}}
This example detects any cheaters using these cheats on your server and sends them to hell, or you could kick them if you trigger a server event which does that.
<syntaxhighlight lang="lua">
function clientCheatScan()
        glp = getLocalPlayer()
if isWorldSpecialPropertyEnabled("aircars") then
clientCheat()
end
if isWorldSpecialPropertyEnabled("hovercars") then
clientCheat()
end
if isWorldSpecialPropertyEnabled("extrabunny") then
clientCheat()
end
if isWorldSpecialPropertyEnabled("extrajump") then
clientCheat()
end
end
setTimer(clientCheatScan, 15000, 0)
 
function clientCheat() -- This function will send them to hell.
fadeCamera(false, 1, 255, 0, 0)
x,y,z = getElementPosition(glp)
createExplosion(x,y,z, 1)
toggleAllControls(false, true, true)
createMarker(x,y,z, "cylinder", 1, 1, 1, 1)
setTimer(clientCheat, 200, 1)
outputChatBox("WELCOME TO CHEATERS HELL LMAO!")
end
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Shared world functions}}
{{World functions}}

Latest revision as of 12:42, 9 November 2024

ADDED/UPDATED IN VERSION 1.6.0 r22195:
Added also as a server-side function. Previously only available as a client-side function.

Checks if a special world property (cheat) is enabled or not.

Syntax

bool isWorldSpecialPropertyEnabled ( string propname )

OOP Syntax Help! I don't understand this!

Counterpart: setWorldSpecialPropertyEnabled


Required Arguments

Returns

Returns true if the property is enabled, false if it is disabled or the specified property name is invalid.

Example

Accessories-text-editor.png Script Example Missing Function IsWorldSpecialPropertyEnabled needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.


See Also