Duff1995 Posted February 23, 2021 Share Posted February 23, 2021 -- no caso eu queria fazer para o painel que é definido como "Pdx" abrice por um comando ex /abrir -- function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelrota", true) addEventHandler("painelrota", root , abrir) Link to comment
Moderators Citizen Posted February 23, 2021 Moderators Share Posted February 23, 2021 [Moved from Scripting >Tutorials] Hello, Your post doesn't match the requirements to be considered a tutorial and is too short. You do not explain in details how to use it, the code shows bad practices, is not indented and actually has an error because Pdx is not defined. Also you must write the description in english in this category. Thanks for understanding. Link to comment
Duff1995 Posted February 23, 2021 Author Share Posted February 23, 2021 eu gostaria de abrir este painel por comando function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then ---So Mude "PCC" Grupo que vai poder abrir o painel ! triggerClientEvent(thePlayer, "painelrota", getRootElement()) end end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) function reparar() local veiculo = getPedOccupiedVehicle(source) if isPedInVehicle(source) then fixVehicle(veiculo) end end addEvent("reparar", true) addEventHandler("reparar", getRootElement(), reparar) function armas () giveWeapon( source, 24, 999, true ) giveWeapon( source, 27, 999, true ) giveWeapon( source, 34, 999, true ) giveWeapon( source, 32, 999, true ) end addEvent("armasrota",true) addEventHandler ( "armasrota", getRootElement(), armas ) function money () -- get the amount of money from the player who entered the command setPlayerMoney(root, 1000000) -- if money is more than 1000 end addEvent("moneyrt",true) addEventHandler ( "moneyrt", getRootElement(), money ) function money1 () -- get the amount of money from the player who entered the command setPlayerMoney(root, 10000000) -- if money is more than 1000 end addEvent("moneyrt1",true) addEventHandler ( "moneyrt1", getRootElement(), money1 ) Link to comment
Other Languages Moderators Lord Henry Posted February 25, 2021 Other Languages Moderators Share Posted February 25, 2021 Tópico movido para Programação em Lua. Da próxima vez, utilize o botão <> do fórum para postar seu código. Não cole direto no texto. 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