IsGlitchEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 5 users not shown)
Line 8: Line 8:
===Required Arguments===
===Required Arguments===
*'''glitchName:''' the name of the property to set. Possible values are:
*'''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.
{{Glitches}}
**'''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===
Returns ''true'' if if the glitch was enabled, or ''false'' if it is disabled.
Returns ''true'' if if the glitch was enabled, or ''false'' if it is disabled.


==Example==
==Example==
This example shows how to create command which changes setGlitchEnabled status.
This example outputs weather the "fastmove" glitch is enabled or not.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function antiGlitch ( human )
setGlitchEnabled("fastmove",true) -- Enable the fastmove glitch at resource start.
local adminsGroup = aclGetGroup ( "Admin" )
 
local playerName = getPlayerName ( human )
function checkIsEnabled(thePlayer,command)
        -- check player's admin rights
if (isGlitchEnabled("fastmove")) then -- Check weather fastmove is enabled or not.
if ( isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) ) then
outputChatBox("fastmove is enabled.",thePlayer,255,255,0) -- If so, output that it's enabled.
                -- check is quickreaload and fastfire glitches enabled
else
if (isGlitchEnabled( "quickreload" ) and isGlitchEnabled( "fastfire" ) == true) then
outputChatBox("fastmove is not enabled.",thePlayer,255,0,0) -- If not, output that it isn't enabled.
                        -- if they are glitches are enabled then we need to disable them
                        setGlitchEnabled ( "quickreload", false )
setGlitchEnabled ( "fastfire", false )
outputChatBox ( "Anti-Glitch is turned off!" )
elseif (isGlitchEnabled( "quickreload" ) and isGlitchEnabled( "fastfire" ) == false) then
setGlitchEnabled ( "quickreload", true )
setGlitchEnabled ( "fastfire", true )
outputChatBox ( "Anti-Glitch is turned on!" )
end
else  
outputChatBox ( "You don't have access to this command", human )
end
end
end
end
addCommandHandler( "antiglitch", antiGlitch )
addCommandHandler("glitch",checkIsEnabled)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Server functions}}
{{Server functions}}
[[Category:Needs_Example]]

Latest revision as of 17:48, 26 March 2016

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). Side effect: also enables the "crouchslide" bug - use the "NoCrouchSlide" resource to remedy this.
  • 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.
  • crouchbug: This is the glitch where the post shooting animation can be aborted by using the crouch key.
  • highcloserangedamage: Enabling this removes the extremely high damage guns inflict when fired at very close range.
  • hitanim: Enabling this allows 'hit by bullet' animations to interrupt player aiming.
  • fastsprint: Enabling fastsprint allows players to tap space with a macro to boost their speed beyond normal speeds of GTASA.
  • baddrivebyhitbox: This glitch leaves players invulnerable to gun fire when performing certain driveby animations.
  • quickstand: This glitch allows players to quickly stand up by pressing the crouch, sprint or jump controls just after releasing the aim weapon button while using one and being ducked.
  • kickoutofvehicle_onmodelreplace: This glitch enables the old behavior where players get warped out of a vehicle when the model is replaced.
  • ADDED/UPDATED IN VERSION 1.6.0 r23281:
    vehicle_rapid_stop: This glitch enables the old behavior of vehicles (pre-high FPS fix, see PR: #4243 & #2784)

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