murilo2929 Posted September 23, 2019 Share Posted September 23, 2019 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
Other Languages Moderators Lord Henry Posted September 23, 2019 Other Languages Moderators Share Posted September 23, 2019 bindKey Link to comment
murilo2929 Posted September 23, 2019 Author Share Posted September 23, 2019 39 minutes ago, Lord Henry said: bindKey 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
Furzy Posted September 23, 2019 Share Posted September 23, 2019 (edited) 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 September 23, 2019 by Furzy Link to comment
murilo2929 Posted September 24, 2019 Author Share Posted September 24, 2019 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
Other Languages Moderators Lord Henry Posted September 24, 2019 Other Languages Moderators Share Posted September 24, 2019 Os parâmetros de função do evento onPlayerJoin não são esses. Preste atenção na wiki. Link to comment
murilo2929 Posted September 25, 2019 Author Share Posted September 25, 2019 4 hours ago, Lord Henry said: Os parâmetros de função do evento onPlayerJoin não são esses. Preste atenção na wiki. Não conseguir ver onde esta o erro, poderia me ajudar? Link to comment
Other Languages Moderators Lord Henry Posted September 25, 2019 Other Languages Moderators Share Posted September 25, 2019 Linha 5. Link to comment
DNL291 Posted September 25, 2019 Share Posted September 25, 2019 Ativar a bind no onPlayerJoin pode causar erro no trigger, visto que o cliente não estará iniciado. Considere trocar o evento para o onPlayerLogin. 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