Jump to content

help setGlitchEnabled


Recommended Posts

  
function resourceStart () 
    setGlitchEnabled ( "quickreload", true ) 
    setGlitchEnabled ( "fastmove", true ) 
    setGlitchEnabled ( "fastfire", true ) 
    setGlitchEnabled ( "crouchbug", true ) 
    if not allow[weapon] then 
        setPedWeaponSlot ( source, 1 ) 
    end 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( ), resourceStart ) 
  
function resourceStop () 
    setGlitchEnabled ( "quickreload", false ) 
    setGlitchEnabled ( "fastmove", false ) 
    setGlitchEnabled ( "fastfire", false ) 
    setGlitchEnabled ( "crouchbug", false ) 
end 
  
addEventHandler ( "onResourceStop", getResourceRootElement ( ), resourceStop ) 
  
allow = { [24] = true, [25] = true, [33] = true, [34] = true } 
  

what is the problem, is not allow all weapons.

Link to comment

Try this:

local allow = { [24] = true, [25] = true, [33] = true, [34] = true } 
function resourceStart () 
    setGlitchEnabled ( "quickreload", true ) 
    setGlitchEnabled ( "fastmove", true ) 
    setGlitchEnabled ( "fastfire", true ) 
    setGlitchEnabled ( "crouchbug", true ) 
end 
addEventHandler ( "onResourceStart",resourceRoot, resourceStart ) 
  
function resourceStop () 
    setGlitchEnabled ( "quickreload", false ) 
    setGlitchEnabled ( "fastmove", false ) 
    setGlitchEnabled ( "fastfire", false ) 
    setGlitchEnabled ( "crouchbug", false ) 
end 
addEventHandler ( "onResourceStop",resourceRoot, resourceStop ) 
  
addEventHandler("onPlayerWeaponSwitch",root,function(pWep,nWep) 
    if not allow[pWep] or not allow[nWep] then 
        setPedWeaponSlot ( source, 1 ) 
    end 
end) 

Link to comment

Try. (Not Tested)

local allow = { [24] = true, [25] = true, [33] = true, [34] = true } 
function resourceStart () 
    if allow then 
    setGlitchEnabled ( "quickreload", true ) 
    setGlitchEnabled ( "fastmove", true ) 
    setGlitchEnabled ( "fastfire", true ) 
    setGlitchEnabled ( "crouchbug", true ) 
     end 
end 
addEventHandler ( "onResourceStart",resourceRoot, resourceStart ) 
  
function resourceStop () 
    setGlitchEnabled ( "quickreload", false ) 
    setGlitchEnabled ( "fastmove", false ) 
    setGlitchEnabled ( "fastfire", false ) 
    setGlitchEnabled ( "crouchbug", false ) 
end 
addEventHandler ( "onResourceStop",resourceRoot, resourceStop ) 

Link to comment

You can't just do that. Because that you need has to be triggered with "onPedWeaponSwitch", but if someone switches his weapon to a non-allowed one, then the glitch will be disabled for ALL THE PLAYERS, also for ones who have an allowed weapon, because setGlitchEnabled is a server-side function.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...