Jump to content

bad argument @ bindKey


Recommended Posts

estou á muito tempo aqui tentando resolver esse erro, já tentei de 2 formas diferentes

nesse aqui ele dá bad argument @ bindKey

function AbrirPainel ()
if painel == false then
	addEventHandler ( "onClientRender", root, PainelPrincipal )
	painel = true
else
	removeEventHandler ( "onClientRender", root, PainelPrincipal )
	painel = false
end
end
bindKey("F2" , "down" , AbrirPainel)

nesse aqui não dá erro nenhum mas o painel não abre.

function AbrirPainel ()
if painel == false then
	addEventHandler ( "onClientRender", root, PainelPrincipal )
	painel = true
else
	removeEventHandler ( "onClientRender", root, PainelPrincipal )
	painel = false
end
end

function bindpainel (commandName)
	bindKey("F2" , "down" , AbrirPainel)
end
addCommandHandler("painelp" , bindpainel)

 

Edited by Renaz
Link to comment

Não está dando esse erro mais , agora é "attempt to call global 'keyBind' (a nill value)

function AbrirPainel()
if painel == false then
	addEventHandler ("onClientRender", root, PainelPrincipal)
	painel = true
else
	removeEventHandler ("onClientRender", root, PainelPrincipal)
	painel = false
end
end
keyBind("F2" , "down" , AbrirPainel)

 

Link to comment
2 minutes ago, Renaz said:

Não está dando esse erro mais , agora é "attempt to call global 'keyBind' (a nill value)


function AbrirPainel()
if painel == false then
	addEventHandler ("onClientRender", root, PainelPrincipal)
	painel = true
else
	removeEventHandler ("onClientRender", root, PainelPrincipal)
	painel = false
end
end
keyBind("F2" , "down" , AbrirPainel)

 

n existe esse keybind que vc colocou

 

 

  • Thanks 1
Link to comment
painel = false

function AbrirPainel()
if painel == false then
	addEventHandler ("onClientRender", root, PainelPrincipal)
	painel = true
else
	removeEventHandler ("onClientRender", root, PainelPrincipal)
	painel = false
end
end
bindKey("B" , "down" , AbrirPainel)

function PainelPrincipal()
        dxDrawLine(23 - 1, 174 - 1, 23 - 1, 513, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 174 - 1, 23 - 1, 174 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 513, 218, 513, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 513, 218, 174 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 174, 195, 339, tocolor(0, 0, 0, 144), false)
        dxDrawRectangle(23, 174, 195, 44, tocolor(255, 63, 63, 182), false)
        dxDrawText("Painel Pessoal", 25 - 1, 177 - 1, 213 - 1, 214 - 1, tocolor(0, 0, 0, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Painel Pessoal", 25 + 1, 177 - 1, 213 + 1, 214 - 1, tocolor(0, 0, 0, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Painel Pessoal", 25 - 1, 177 + 1, 213 - 1, 214 + 1, tocolor(0, 0, 0, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Painel Pessoal", 25 + 1, 177 + 1, 213 + 1, 214 + 1, tocolor(0, 0, 0, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Painel Pessoal", 25, 177, 213, 214, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawLine(23 - 1, 219 - 1, 23 - 1, 255, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 219 - 1, 23 - 1, 219 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 255, 218, 255, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 255, 218, 219 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 219, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawText("Admin", 24, 218, 218, 254, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawLine(23 - 1, 255 - 1, 23 - 1, 291, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 255 - 1, 23 - 1, 255 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 291, 218, 291, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 291, 218, 255 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 255, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 291 - 1, 23 - 1, 327, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 291 - 1, 23 - 1, 291 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 327, 218, 327, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 327, 218, 291 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 291, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 327 - 1, 23 - 1, 363, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 327 - 1, 23 - 1, 327 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 363, 218, 363, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 363, 218, 327 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 327, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 363 - 1, 23 - 1, 399, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 363 - 1, 23 - 1, 363 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 399, 218, 399, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 399, 218, 363 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 363, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 399 - 1, 23 - 1, 435, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 399 - 1, 23 - 1, 399 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 435, 218, 435, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 435, 218, 399 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 399, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 435 - 1, 23 - 1, 471, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 435 - 1, 23 - 1, 435 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 471, 218, 471, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 471, 218, 435 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 435, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawLine(23 - 1, 471 - 1, 23 - 1, 507, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 471 - 1, 23 - 1, 471 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(23 - 1, 507, 218, 507, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(218, 507, 218, 471 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(23, 471, 195, 36, tocolor(255, 255, 255, 0), false)
        dxDrawText("Policia", 23, 254, 217, 290, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Mecânico", 23, 291, 217, 327, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Inem", 24, 327, 218, 363, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Inventário", 24, 363, 218, 399, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Animações", 24, 399, 218, 435, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Veiculo", 23, 435, 217, 471, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawText("Informações", 24, 471, 218, 507, tocolor(255, 255, 255, 255), 0.90, "pricedown", "center", "center", false, false, false, false, false)
        dxDrawRectangle(23, 507, 195, 6, tocolor(255, 63, 63, 182), false)
end
<meta>
    <script src="server.Lua" />
    <script src="client.Lua" />
</meta>

 

Link to comment
<meta>
    <script src="client.Lua" type="client" />
    <script src="sever.Lua" type="server" />
</meta>

irmão tenta por assim

Edited by Lord Henry
Removido citação desnecessária e código formatado de texto para XML
  • Thanks 1
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...