Jump to content

Can anyone help me


rafael15420

Recommended Posts

I wanted the VIPs could not use the VIP panel all the time, wish they would only spawn once or every 40 minutes :D

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

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

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