Jump to content

VIP PANEL | Help to set only to the group VIP


enzopaul4

Recommended Posts

How can i make , that only the group "VIP" to have acces to /vip?

 

client :


Panel = {
    button = {},
    window = {}
}


function window()
showCursor(true)
isPanelShowing = true
local player = getLocalPlayer()
local screenW, screenH = guiGetScreenSize()
        Panel.window[1] = guiCreateWindow((screenW - 367) / 2, (screenH - 376) / 2, 367, 376, "VIP_Panel 1.1", false)
        guiWindowSetSizable(Panel.window[1], false)
        guiSetAlpha(Panel.window[1], 1.00)

        Panel.button[1] = guiCreateButton(68, 25, 238, 44, "VIP Equip", false, Panel.window[1])
        guiSetProperty(Panel.button[1], "NormalTextColour", "FFFFFFFF")
        Panel.button[2] = guiCreateButton(68, 75, 238, 44, "Spawn Infernus", false, Panel.window[1])
        guiSetProperty(Panel.button[2], "NormalTextColour", "FFFFFFFF")
        Panel.button[3] = guiCreateButton(68, 125, 238, 44, "Spawn Hunter", false, Panel.window[1])
        guiSetProperty(Panel.button[3], "NormalTextColour", "FFFFFFFF")
        Panel.button[4] = guiCreateButton(68, 175, 238, 44, "Add Armor", false, Panel.window[1])
        guiSetProperty(Panel.button[4], "NormalTextColour", "FFFFFFFF")
        Panel.button[5] = guiCreateButton(68, 225, 238, 44, "Fill Health", false, Panel.window[1])
        guiSetProperty(Panel.button[5], "NormalTextColour", "FFFFFFFF")
        Panel.button[6] = guiCreateButton(68, 274, 238, 44, "Delete Wandet Level", false, Panel.window[1])
        guiSetProperty(Panel.button[6], "NormalTextColour", "FFFFFFFF")
        Panel.button[7] = guiCreateButton(68, 323, 238, 44, "Fix Motor", false, Panel.window[1])
        guiSetProperty(Panel.button[7], "NormalTextColour", "FFFFFFFF")
        Panel.button[8] = guiCreateButton(324, 25, 33, 36, "X", false, Panel.window[1])
        guiSetFont(Panel.button[8], "clear-normal")
        guiSetProperty(Panel.button[8], "NormalTextColour", "FFAAAAAA")    
        
        addEventHandler("onClientGUIClick",Panel.button[8],function()  -- Close Window
        destroyElement(Panel.window[1])
        showCursor(false)
        isPanelShowing = false
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[2],function()
        triggerServerEvent("infernus",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[3],function()
        triggerServerEvent("hunter",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[5],function()
        setElementHealth(player,999)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[4],function()
        triggerServerEvent("givearmor",player,player)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[7],function( player )
        if not getPedOccupiedVehicle(player) then return end
        setElementHealth(getPedOccupiedVehicle(player),1000)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[6],function()
        triggerServerEvent("wandet",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[1],function()
        triggerServerEvent("weaponbox",localPlayer,localPlayer)
        end,false)
end
addCommandHandler("vip", window)

 

 

 

Server: 

 

 

addEvent("infernus",true)
addEventHandler("infernus", root,function(player)
local x, y, z = getElementPosition( player ) 
local infernus = createVehicle(411,x, y, z)
outputChatBox(" * You Spawn the Infernus! * ",player, 0,255,0)
setTimer(warpPedIntoVehicle, 100, 1, player, infernus, 0)
end)

addEvent("hunter",true)
addEventHandler("hunter", root,function(player)
local x, y, z = getElementPosition( player ) 
local hunter = createVehicle(425,x, y, z)
outputChatBox(" * You Spawn the Hunter! * ",player, 0,255,0)
setTimer(warpPedIntoVehicle, 100, 1, player, hunter, 0)
end)

addEvent("givearmor", true)
addEventHandler("givearmor",getRootElement(), function(player)
setPedArmor(player,999)
end)

addEvent("wandet", true)
addEventHandler("wandet",root , function( player )
setPlayerWantedLevel(player,0)
end)

addEvent("weaponbox", true)
addEventHandler("weaponbox",root, function()
giveWeapon(source,1,99999,true)
giveWeapon(source,31,99999,true)
giveWeapon(source,24,99999,true)
giveWeapon(source,29,99999,true)
giveWeapon(source,34,99999,true)
giveWeapon(source,35,99999,true)
giveWeapon(source,16,99999,true)
    outputChatBox(" * You've got the 'Weaponbox' successful! ' ",source, 0,255,0)
end)

 

 

 

THANK YOU!

Link to comment

Panel = {
    button = {},
    window = {}
}


function window()
showCursor(true)
isPanelShowing = true
local player = getLocalPlayer()
local screenW, screenH = guiGetScreenSize()
        Panel.window[1] = guiCreateWindow((screenW - 367) / 2, (screenH - 376) / 2, 367, 376, "VIP_Panel 1.1", false)
        guiWindowSetSizable(Panel.window[1], false)
        guiSetAlpha(Panel.window[1], 1.00)

        Panel.button[1] = guiCreateButton(68, 25, 238, 44, "VIP Equip", false, Panel.window[1])
        guiSetProperty(Panel.button[1], "NormalTextColour", "FFFFFFFF")
        Panel.button[2] = guiCreateButton(68, 75, 238, 44, "Spawn Infernus", false, Panel.window[1])
        guiSetProperty(Panel.button[2], "NormalTextColour", "FFFFFFFF")
        Panel.button[3] = guiCreateButton(68, 125, 238, 44, "Spawn Hunter", false, Panel.window[1])
        guiSetProperty(Panel.button[3], "NormalTextColour", "FFFFFFFF")
        Panel.button[4] = guiCreateButton(68, 175, 238, 44, "Add Armor", false, Panel.window[1])
        guiSetProperty(Panel.button[4], "NormalTextColour", "FFFFFFFF")
        Panel.button[5] = guiCreateButton(68, 225, 238, 44, "Fill Health", false, Panel.window[1])
        guiSetProperty(Panel.button[5], "NormalTextColour", "FFFFFFFF")
        Panel.button[6] = guiCreateButton(68, 274, 238, 44, "Delete Wandet Level", false, Panel.window[1])
        guiSetProperty(Panel.button[6], "NormalTextColour", "FFFFFFFF")
        Panel.button[7] = guiCreateButton(68, 323, 238, 44, "Fix Motor", false, Panel.window[1])
        guiSetProperty(Panel.button[7], "NormalTextColour", "FFFFFFFF")
        Panel.button[8] = guiCreateButton(324, 25, 33, 36, "X", false, Panel.window[1])
        guiSetFont(Panel.button[8], "clear-normal")
        guiSetProperty(Panel.button[8], "NormalTextColour", "FFAAAAAA")    
        
        addEventHandler("onClientGUIClick",Panel.button[8],function()  -- Close Window
        destroyElement(Panel.window[1])
        showCursor(false)
        isPanelShowing = false
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[2],function()
        triggerServerEvent("infernus",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[3],function()
        triggerServerEvent("hunter",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[5],function()
        setElementHealth(player,999)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[4],function()
        triggerServerEvent("givearmor",player,player)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[7],function( player )
        if not getPedOccupiedVehicle(player) then return end
        setElementHealth(getPedOccupiedVehicle(player),1000)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[6],function()
        triggerServerEvent("wandet",localPlayer,localPlayer)
        end,false)
        
        addEventHandler("onClientGUIClick",Panel.button[1],function()
        triggerServerEvent("weaponbox",localPlayer,localPlayer)
        end,false)
end
addEvent( "GUIVIP", true )
addEventHandler( "GUIVIP", getRootElement(), window)
function marcosfunc ( thePlayer , commandName )
   local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
   if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then 
   triggerClientEvent ( thePlayer, "GUIVIP", thePlayer)
   else
   outputChatBox ( "Sai fora remelau <3",thePlayer,255,0,0,true)
   end
 end 
addCommandHandler ( "vip", marcosfunc )

addEvent("infernus",true)
addEventHandler("infernus", root,function(player)
local x, y, z = getElementPosition( player ) 
local infernus = createVehicle(411,x, y, z)
outputChatBox(" * You Spawn the Infernus! * ",player, 0,255,0)
setTimer(warpPedIntoVehicle, 100, 1, player, infernus, 0)
end)

addEvent("hunter",true)
addEventHandler("hunter", root,function(player)
local x, y, z = getElementPosition( player ) 
local hunter = createVehicle(425,x, y, z)
outputChatBox(" * You Spawn the Hunter! * ",player, 0,255,0)
setTimer(warpPedIntoVehicle, 100, 1, player, hunter, 0)
end)

addEvent("givearmor", true)
addEventHandler("givearmor",getRootElement(), function(player)
setPedArmor(player,999)
end)

addEvent("wandet", true)
addEventHandler("wandet",root , function( player )
setPlayerWantedLevel(player,0)
end)

addEvent("weaponbox", true)
addEventHandler("weaponbox",root, function()
giveWeapon(source,1,99999,true)
giveWeapon(source,31,99999,true)
giveWeapon(source,24,99999,true)
giveWeapon(source,29,99999,true)
giveWeapon(source,34,99999,true)
giveWeapon(source,35,99999,true)
giveWeapon(source,16,99999,true)
    outputChatBox(" * You've got the 'Weaponbox' successful! ' ",source, 0,255,0)
end)

 

 

agora é com você

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