rafael15420 Posted January 17, 2015 Share Posted January 17, 2015 I wanted the VIPs could not use the VIP panel all the time, wish they would only spawn once or every 40 minutes client --- function VipAbrir ( thePlayer , commandName ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "GUIVIP", thePlayer) else outputChatBox ( "You are not a VIP member",thePlayer) end end addCommandHandler ( "vip", VipAbrir ) --Armamento -------------------------------------------------------------------------- function Paquete1Funcion () giveWeapon ( source, 31, 350) giveWeapon ( source, 34, 100) end addEvent( "Paquete1", true ) addEventHandler( "Paquete1", getRootElement(), Paquete1Funcion ) -------------------------------------------------------------------------- --Equipamentos function greeting2Handler () setElementData(source, "Map", 1) setElementData(source, "GPS", 1) setElementData(source, "Milk", 2) setElementData(source, "Pizza", 2) setElementData(source, "Medic Kit", 2) setElementData(source, "Morphine", 2) end addEvent( "onGreeting2", true ) addEventHandler( "onGreeting2", getRootElement(), greeting2Handler ) Link to comment
n3wage Posted January 17, 2015 Share Posted January 17, 2015 Try (untested): Tick_ = {} function VipAbrir ( thePlayer ) if not Tick_[thePlayer] or Tick_[thePlayer] < getTickCount() then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "GUIVIP", thePlayer) Tick_[thePlayer] = getTickCount() + ( 40 * 60000 ) else outputChatBox ( "You are not a VIP member",thePlayer) end else outputChatBox ( "Wait ".. math.floor ( ( Tick_[thePlayer] - getTickCount() ) / 60000 ) .." Minutes until open the panel Again !", thePlayer ) end end addCommandHandler ( "vip", VipAbrir ) Link to comment
rafael15420 Posted January 17, 2015 Author Share Posted January 17, 2015 FuSioN_ worked perfectly thank you 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