Não consegui
client.Lua:
function ()
Painel = guiCreateWindow(258, 158, 484, 470, "Painel VIP", false)
guiWindowSetSizable(Painel, false)
PegarArmas = guiCreateButton(0.04, 0.16, 0.27, 0.11, "armas", true, Painel)
guiSetFont(PegarArmas, "default-bold-small")
guiSetProperty(PegarArmas, "NormalTextColour", "E947F9AB")
pegarCarro = guiCreateButton(0.04, 0.39, 0.27, 0.12, "carro", true, Painel)
guiSetFont(pegarCarro, "default-bold-small")
guiSetProperty(pegarCarro, "NormalTextColour", "E947F9AB")
PegarJetpack = guiCreateButton(0.05, 0.67, 0.27, 0.13, "jetpack", true, Painel)
guiSetFont(PegarJetpack, "default-bold-small")
guiSetProperty(PegarJetpack, "NormalTextColour", "E947F9AB")
botaodestruir = guiCreateButton(0.38, 0.80, 0.30, 0.10, "destruir", true,Painel)
guiSetFont(botaodestruir, "default-bold-small")
guiSetProperty(botaodestruir, "NormalTextColour", "FF0AF468")
addEventHandler("onClientGUIClick",PegarArmas,ClicarNoBotao)
addEventHandler("onClientGUIClick",PegarJetpack,CliaBotao)
addEventHandler("onClientGUIClick",pegarCarro,ClicaBotao)
addEventHandler("onClientGUIClick",botaodestruir,CliaBot)
end
function abrirPainel ()
if guiGetVisible (Painel) then
guiSetVisible (Painel, false)
showCursor (false)
else
guiSetVisible (Painel, true)
showCursor (true)
end
end
addEvent ("mostratVIP", true)
addEventHandler ("mostratVIP", getRootElement(), abrirPainel)
function ClicarNoBotao(button,state)
if(button == "left")then
triggerServerEvent("criarArmasEvento",localPlayer)
end
end
function ClicaBotao(button,state)
if(button == "left")then
triggerServerEvent("criarCarroEvento",localPlayer)
end
end
function CliaBotao(button,state)
if(button == "left")then
triggerServerEvent("criarJatEvento",localPlayer)
end
end
function CliaBot(button,state)
if(button == "left")then
triggerServerEvent("DestroirEvento",localPlayer)
end
end
server.Lua:
addCommandHandler ("vip", function (thePlayer , cmd)
if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup ("VIP")) then
triggerClientEvent (thePlayer, "mostratVIP", thePlayer)
else
outputChatBox ("You are not VIP!", thePlayer)
end
end)
function EventoArma ()
giveWeapon(source, 31 , 9999)
giveWeapon(source, 27 , 9999)
giveWeapon(source, 34 , 9999)
giveWeapon(source, 16 , 9999)
giveWeapon(source, 4 , 9999)
giveWeapon(source, 24 , 9999)
giveWeapon(source, 28 , 9999)
giveWeapon(source, 31 , 9999)
end
addEvent("criarArmasEvento",true)
addEventHandler("criarArmasEvento",root,EventoArma)
function EventoJat ()
if ( doesPedHaveJetPack ( source ) ) then -- if the player has a jetpack
removePedJetPack ( source ) -- remove it
else
givePedJetPack ( source ) -- otherwise give him oneend
end
end
addEvent("criarJatEvento",true)
addEventHandler("criarJatEvento",root,EventoJat)
blip = createBlipAttachedTo(veiculo, 51, 3, 255, 0, 0, 255, 0, 65535)
-----------------------------------
veiculo = {}
function EventoCarro()
if getPedOccupiedVehicle(source) then
displayServerMessage(source, "Saia Do Veiculo Primeiro", "warning")
return
end
if veiculo[source] and isElement(veiculo[source]) then
destroyElement(veiculo[source])
end
local x, y, z = getElementPosition(source)
veiculo[source] = createVehicle(402, x, y, z)
warpPedIntoVehicle(source, veiculo[source])
displayServerMessage(source, "Você Pegou carro Vip", "confirm")
end
addEvent("criarCarroEvento", true)
addEventHandler("criarCarroEvento", getRootElement(), EventoCarro)
--------------------------
function sair ()
if (irineu) and isElement(irineu) then
destroyElement (irineu)
destroyElement (blip)
end
end
addEvent("DestroirEvento",true)
addEventHandler ("DestroirEvento",root, sair)
oque estou fazendo de errado? ?