--Client side
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}
GUIEditor_Window[1] = guiCreateWindow(244,192,289,309,"Panel Miembros Que Pagan",false)
guiSetVisible ( GUIEditor_Window[1], false )
GUIEditor_Button[1] = guiCreateButton(73,31,124,39,"Repair",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(72,83,129,38,"Flip",false,GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(71,140,124,39,"Get Nitro",false,GUIEditor_Window[1])
GUIEditor_Button[4] = guiCreateButton(19,275,237,25,"Close [M]",false,GUIEditor_Window[1])
GUIEditor_Label[1] = guiCreateLabel(11,199,266,17,"Todo En este panel No tiene Costo Para Ti.",false,GUIEditor_Window[1])
GUIEditor_Label[2] = guiCreateLabel(64,220,166,43,"premium!",false,GUIEditor_Window[1])
guiLabelSetColor(GUIEditor_Label[2],255,0,0,0)
guiSetFont(GUIEditor_Label[2],"sa-gothic")
addEventHandler("onClientGUIClick",getRootElement(),
function ()
if (source == GUIEditor_Button[4]) then
guiSetVisible ( GUIEditor_Window[1], false )
showCursor(false)
end
end)
addEvent("openPremiumPanel",true)
addEventHandler("openPremiumPanel",getRootElement(),
function ()
guiSetVisible (GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1]))
showCursor(not isCursorShowing())
end)
--Server side
function showPremiumPanel(thePlayer)
local account = getPlayerAccount(thePlayer)
if account then
local accountname = getAccountName(account)
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Sr.Admin" )) then
triggerClientEvent (thePlayer, "openPremiumPanel", getRootElement())
else
outputChatBox ("Premium: Access denied", thePlayer, 255, 0, 0)
end
end
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ),
function ()
for index, player in ipairs ( getElementsByType ( "player" ) ) do
bindKey ( player, "M", "down", showPremiumPanel )
end
end)
addEventHandler ( "onPlayerJoin", getRootElement(),
function ()
bindKey ( source, "M", "down", showPremiumPanel )
end)
addEventHandler ( "onResourceStop", getResourceRootElement ( getThisResource() ),
function ()
for index, player in ipairs ( getElementsByType ( "player" ) ) do
unbindKey ( player, "M", "down", showPremiumPanel )
end
end)
Works (tested).