Jump to content

BindKey


SkatCh

Recommended Posts

Posted

hi guys please can any one fix this for me . i want when the player press F11 = close Hud , and if he press it again = Hud open .

i tried this i am new scripter but it dosen't work :) it just close the Hud .

Note : i create My own Hud it's not GTA Hud so "showPlayerHudComponent" it will never work ,

  
addEventHandler( "onClientKey", root, 
function(button,press) 
    
    if button == "F11" then 
        removeEventHandler("onClientHUDRender", getRootElement(), HudOpening) 
        else 
    addEventHandler("onClientHUDRender", getRootElement(), HudOpening)  
    end 
    
end ) 

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

Try Using another , Key

addEventHandler( "onClientKey", root,  
function(button,press)  
    if button == "F11" then 
    removeEventHandler("onClientHUDRender", root, HudOpening) 
    elseif button == "F10" then 
     addEventHandler ( "onClientHUDRender", root, HudOpening ) 
  
    end 
end 
) 

--ClientSide ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

no i want it with F11 (open, close) with the same key .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted
local state = false 
  
bindKey ( "F11", "down", 
    function ( ) 
        state = ( not state ) 
        if ( state ) then 
            addEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) 
        else 
            removeEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...