-- Client side
ventana = guiCreateWindow(202, 174, 415, 223, "Panel VIP", false)
guiWindowSetSizable(ventana, false)
guiSetVisible(ventana,false)
jtpkon = guiCreateButton(10, 102, 123, 46, "Jetpack:ON", false, ventana)
chaleco = guiCreateButton(143, 102, 123, 46, "Chaleco", false, ventana)
cerrar = guiCreateButton(143, 169, 123, 46, "Cerrar", ventana)
armas = guiCreateButton(10, 27, 123, 46, "Armas VIP", false, ventana)
skin = guiCreateButton(143, 27, 123, 46, "Skin VIP", false, ventana)
jtpkoff = guiCreateButton(10, 169, 123, 46, "Jetpack:OFF", false, ventana)
stats = guiCreateButton(276, 27, 120, 46, "Estadisticas\n al\n Maximo", false, ventana)
function arma ()
triggerServerEvent("onGreeting", localPlayer)
end
function abrirYCerrar( )
if getElementData(getLocalPlayer(),"vip") == true then
if guiGetVisible(ventana) then
guiSetVisible(ventana,false)
showCursor(false)
else
guiSetVisible(ventana,true)
showCursor(true)
end
end
end
bindKey("F2","down",abrirYCerrar)
function skin1 ()
showCursor (true)
triggerServerEvent ( "skinvip", getRootElement() )
end
addEvent("skin1",true)
function chaleco1 ()
showCursor (true)
triggerServerEvent ( "chalecovip", localPlayer )
end
function Exit ()
showCursor (false)
guiSetVisible (ventana, false )
end
function jeton ()
triggerServerEvent ( "jetpkon", localPlayer )
end
function jetoff ()
triggerServerEvent ( "jetpkoff", localPlayer )
end
function estats ()
triggerServerEvent ( "max", localPlayer )
end
addEventHandler ("onClientGUIClick", armas, arma)
addEventHandler ("onClientGUIClick", skin, skin1)
addEventHandler ("onClientGUIClick", chaleco, chaleco1)
addEventHandler ("onClientGUIClick", cerrar, Exit)
addEventHandler ("onClientGUIClick", jtpkon, jeton)
addEventHandler ("onClientGUIClick", jtpkoff, jetoff)
addEventHandler ("onClientGUIClick", stats, estats)
-- Server side
function onLogin()
local accName = getAccountName ( getPlayerAccount ( source ) )
if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) ) then
setElementData(source,"vip",true)
else
setElementData(source,"vip",false)
end
end
addEventHandler("onPlayerLogin",root,onLogin)
function greetingHandler ()
giveWeapon ( source, 31, 999999 )
giveWeapon ( source, 24, 999999 )
giveWeapon ( source, 27, 999999 )
giveWeapon ( source, 28, 999999 )
giveWeapon ( source, 34, 999999 )
giveWeapon ( source, 17, 999999 )
giveWeapon ( source, 46, 999999 )
end
addEvent( "onGreeting", true )
addEventHandler( "onGreeting", root, greetingHandler )
-----------------------------------------------------------------------------------
function skin ()
setElementModel ( source, 165 )
end
addEvent( "skinvip", true )
addEventHandler( "skinvip", root, skin )
-----------------------------------------------------------------------------------
function chaleco ()
setPedArmor (source,100)
end
addEvent( "chalecovip", true )
addEventHandler( "chalecovip", root, chaleco )
-----------------------------------------------------------------------------------
function jtpk1 ()
givePedJetPack ( source )
end
addEvent( "jetpkon", true )
addEventHandler( "jetpkon", root, jtpk1 )
-----------------------------------------------------------------------------------
function jtpk2 ()
removePedJetPack ( source )
end
addEvent( "jetpkoff", true )
addEventHandler( "jetpkoff", root, jtpk2 )
-----------------------------------------------------------------------------------
function estat ()
setPedStat(source, 23, 999)
setPedStat(source, 24, 999)
setPedStat(source, 69, 999)
setPedStat(source, 70, 999)
setPedStat(source, 71, 999)
setPedStat(source, 72, 999)
setPedStat(source, 73, 999)
setPedStat(source, 74, 999)
setPedStat(source, 75, 999)
setPedStat(source, 76, 999)
setPedStat(source, 77, 999)
setPedStat(source, 78, 999)
setPedStat(source, 79, 999)
setPedStat(source, 229, 999)
setPedStat(source, 225, 999)
end
addEvent( "max", true )
addEventHandler( "max", root, estat )