Gallagher Posted January 6, 2014 Share Posted January 6, 2014 (edited) I wanted the VIPs could not use the VIP panel all the time, wish they would only spawn once. So how do I replace addCommandHandler ("vip", vip) by OnPlayerSpawn? Client --- function vip() triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) end addCommandHandler ("vip", vip) function armavip () showCursor (true) triggerServerEvent ( "onGreeting", getLocalPlayer() ) end function equipvip () showCursor (true) triggerServerEvent ( "onGreeting2", getLocalPlayer() ) end function vip2() painel = guiCreateWindow(450, 250, 448, 280, "Painel V.I.P", false) guiWindowSetSizable(painel, false) showCursor ( true ) guiSetAlpha(painel, 1.00) guiSetProperty(painel, "CaptionColour", "FF6AE419") arma = guiCreateButton(48, 144, 341, 38, "Pegar Armamento", false, painel) equip = guiCreateButton(48, 193, 341, 38, "Pegar Equipamento", false, painel) close = guiCreateButton(156, 250, 114, 37, "Fechar", false, painel) memo = guiCreateMemo(17, 30, 421, 104, "Ola, Painel VIP Feito Por: AzulBananaFosco\n Modificado por: Maikao\n visite: mtaZ.wikiforum.net", false, painel) guiMemoSetReadOnly(memo, true) addEvent( "showvip",true ) addEventHandler ( "onClientGUIClick", arma, armavip, false ) addEventHandler ( "onClientGUIClick", equip, equipvip, false ) playSound("button.mp3") addEventHandler ( "onClientGUIClick", close, function() guiSetVisible(painel, false) showCursor(false) end, false ) end addEvent( "ShowVipPanel", true ) addEventHandler( "ShowVipPanel", getRootElement(), vip2) server-- function greetingHandler () setElementData(source, "M4", 1) setElementData(source, "M4 Mag", 120) setElementData(source, "Hunting Knife", 1) outputChatBox(" #FFFFFF[#00FF00PainelVIP-INFORMA#FFFFFF]:#F70606 Armamento #FFFFFFPego!", thePlayer, 27, 89, 224, true) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), greetingHandler ) function greeting2Handler () setElementData(source, "Coyote Backpack", 1) setElementData(source, "Map", 1) setElementData(source, "GPS", 1) setElementData(source, "Toolbox", 1) outputChatBox(" #FFFFFF[#00FF00PainelVIP-INFORMA#FFFFFF]:#F70606 Equipamento #FFFFFFPego!", thePlayer, 27, 89, 224, true) end addEvent( "onGreeting2", true ) addEventHandler( "onGreeting2", getRootElement(), greeting2Handler ) function PlayerHaveLevel( ) local accName = getAccountName ( getPlayerAccount ( source ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) ) then triggerClientEvent(source, "ShowVipPanel", source ) else outputChatBox("you not VIP",source) end end addEvent( "ClientHaveLevel", true ) addEventHandler( "ClientHaveLevel", getRootElement(), PlayerHaveLevel ) Edited January 6, 2014 by Guest Link to comment
Sasu Posted January 6, 2014 Share Posted January 6, 2014 Replace 'addCommandHandler ("vip", vip)' to 'addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), vip )' Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now