+Gabriel Posted May 17, 2020 Share Posted May 17, 2020 Quote addCommandHandler("roubar", sistema2) Eu só queria saber como eu faço pra trocar essa função de comando, para uma de tecla. Ao invés de ter que digitar o comando, eu queria que apenas pressionasse "F" Link to comment
Moderators Patrick Posted May 17, 2020 Moderators Share Posted May 17, 2020 Wrong language, moved to Portuguese section. Link to comment
Angelo Pereira Posted May 17, 2020 Share Posted May 17, 2020 -- Server-Side / Por Comando addCommandHandler("F", function ( thePlayer ) outputChatBox("Start", thePlayer, 255, 255, 255, true ) end) -- Server-Side / Por Bindkey addEventHandler("onPlayerLogin", root, function ( ) bindKey ( source, "F", "down", sistema2 ) end) addEventHandler("onResourceStart", resourceRoot, function ( ) for i, players in ipairs( getElementsByType("player" ) ) do bindKey ( players, "F", "down", sistema2 ) end end) addEventHandler("onResourceStop", resourceRoot, function ( ) for i, players in ipairs( getElementsByType("player" ) ) do unbindKey ( players, "F", "down", sistema2 ) end end) function sistema2 ( thePlayer ) outputChatBox("Start", thePlayer, 255, 255, 255, true ) end -- Client-Side / Por Comando addCommandHandler("F", function ( ) outputChatBox("Start", 255, 255, 255, true ) end) -- Client-Side / Por Bindkey function sistema2 ( ) outputChatBox("Start", 255, 255, 255, true ) end bindKey("F7", "down", sistema2 ) Espero ter ajudado. Link to comment
HiroShi Posted May 23, 2020 Share Posted May 23, 2020 On 17/05/2020 at 16:23, +Gabriel said: Eu só queria saber como eu faço pra trocar essa função de comando, para uma de tecla. Ao invés de ter que digitar o comando, eu queria que apenas pressionasse "F" bindKey("F", "down", sistema2) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now