Jump to content

Comando com tecla


Recommended Posts

function onRoadblockStart(thePlayer, commandName, parameter)
	if(isRoadblockEditAllowed(thePlayer)) then
		triggerClientEvent(thePlayer, "enableRoadblockGUI", getRootElement(), true)
	end
end
addCommandHandler("rbs", onRoadblockStart, false, false)

Gostaria que quando o player apertasse a tecla F12 esse GUI aparecesse como posso fazer?

Link to comment
39 minutes ago, Lord Henry said:
function funcInput ( thePlayer, key, keyState )
  triggerClientEvent(thePlayer, "enableRoadblockGUI", getRootElement(), true)
end

function bindTheKeys ( thePlayer, commandName )
  bindKey ( thePlayer, "F5", "down", funcInput )
end
addCommandHandler ( "bindme", bindTheKeys )

Testei assim e so funciona quando digito bindme no chat, como fazer para sempre estar ativado?

Link to comment
21 minutes ago, murilo2929 said:

function funcInput ( thePlayer, key, keyState )
  triggerClientEvent(thePlayer, "enableRoadblockGUI", getRootElement(), true)
end

function bindTheKeys ( thePlayer, commandName )
  bindKey ( thePlayer, "F5", "down", funcInput )
end
addCommandHandler ( "bindme", bindTheKeys )

Testei assim e so funciona quando digito bindme no chat, como fazer para sempre estar ativado?

onPlayerJoin

onPlayerLogin

onResourceStart

Edited by Furzy
Link to comment
6 hours ago, Furzy said:

onPlayerJoin

onPlayerLogin

onResourceStart

function funcInput ( thePlayer, key, keyState )
  triggerClientEvent(thePlayer, "enableRoadblockGUI", getRootElement(), true)
end

function bindTheKeys ( thePlayer, commandName )
  bindKey ( thePlayer, "F5", "down", funcInput )
end
addEventHandler ( "onPlayerJoin", getRootElement(), bindTheKeys )

Tentei assim e  nao deu

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