murilo2929 Posted September 23, 2019 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?
Moderators Lord Henry Posted September 23, 2019 Moderators Posted September 23, 2019 bindKey Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
murilo2929 Posted September 23, 2019 Author 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?
Furzy Posted September 23, 2019 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 FURZY'S CUSTOM WEAPON SYSTEM Discord: Furzy#4125
murilo2929 Posted September 24, 2019 Author 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
Moderators Lord Henry Posted September 24, 2019 Moderators Posted September 24, 2019 Os parâmetros de função do evento onPlayerJoin não são esses. Preste atenção na wiki. Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
murilo2929 Posted September 25, 2019 Author 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?
Moderators Lord Henry Posted September 25, 2019 Moderators Posted September 25, 2019 Linha 5. Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
DNL291 Posted September 25, 2019 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. Please do not PM me with scripting related question nor support, use the forums instead.
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