IsGlitchEnabled: Difference between revisions
Jump to navigation
Jump to search
(Added example.) |
|||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This example outputs weather the "fastmove" glitch is enabled or not. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
setGlitchEnabled("fastmove",true) -- Enable the fastmove glitch at resource start. | |||
function checkIsEnabled(thePlayer,command) | |||
if (isGlitchEnabled("fastmove")) then -- Check weather fastmove is enabled or not. | |||
outputChatBox("fastmove is enabled.",thePlayer,255,255,0) -- If so, output that it's enabled. | |||
else | |||
outputChatBox("fastmove is not enabled.",thePlayer,255,0,0) -- If not, output that it isn't enabled. | |||
end | |||
end | |||
addCommandHandler("glitch",checkIsEnabled) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Server functions}} | {{Server functions}} | ||
Revision as of 02:34, 31 May 2010
This function retrieves whether San Andreas game glitches are enabled or not, set by using setGlitchEnabled
Syntax
bool isGlitchEnabled ( string glitchName )
Required Arguments
- glitchName: the name of the property to set. Possible values are:
- quickreload - This is the glitch where switching weapons auto-reloads your weapon, without actually performing the reload animation.
- fastmove - This is the glitch that can be achieved by a certain key combinations whilst standing up after crouching, which allows you to move quickly with slow weapons (e.g. deagle).
- fastfire - This is the glitch that can be achieved by cancelling the full fire animation, allowing you to shoot with slow-fire weapons (e.g. deagle) much faster.
Returns
Returns true if if the glitch was enabled, or false if it is disabled.
Example
This example outputs weather the "fastmove" glitch is enabled or not.
setGlitchEnabled("fastmove",true) -- Enable the fastmove glitch at resource start. function checkIsEnabled(thePlayer,command) if (isGlitchEnabled("fastmove")) then -- Check weather fastmove is enabled or not. outputChatBox("fastmove is enabled.",thePlayer,255,255,0) -- If so, output that it's enabled. else outputChatBox("fastmove is not enabled.",thePlayer,255,0,0) -- If not, output that it isn't enabled. end end addCommandHandler("glitch",checkIsEnabled)
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown