Jump to content

Abrir painel DX por comando


Recommended Posts

-- 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 post
  • Moderators

[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 post
  • Citizen unlocked this topic
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, 24999true )
   giveWeapon( source, 27999true )
   giveWeapon( source, 34999true )
   giveWeapon( source, 32999true )
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 post
  • Other Languages Moderators

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.

OfSmewi.png

Link to post

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