Jump to content

Help Me in resource


Recommended Posts

how do I get the player can use /vip every 30 minutes

function vip() 
    triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() )   
addCommandHandler ("vip", vip) 
function armavip () 
showCursor (true) 
triggerServerEvent ( "onGreeting", getLocalPlayer() ) 
function equipvip () 
showCursor (true) 
triggerServerEvent ( "onGreeting2", getLocalPlayer() ) 
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, "Bem Vindo Ao Painel VIP, Nao Abuse dos Seus Privilegios", false, painel) 
    guiMemoSetReadOnly(memo, true) 
    addEvent( "showvip",true ) 
    addEventHandler ( "onClientGUIClick", arma, armavip, false ) 
    addEventHandler ( "onClientGUIClick", equip, equipvip, false ) 
    addEventHandler ( "onClientGUIClick", close, 
        guiSetVisible(painel, false) 
    end, false ) 
addEvent( "ShowVipPanel", true ) 
addEventHandler( "ShowVipPanel", getRootElement(), vip2) 

Link to comment

create a cooldown timer:

cooldown = setTimer(function() end, 30*60, 1) 

and check if it exists by using:

if not isTimer(cooldown) then 
    -- Do something 

if you plan to use this server side (multiple players), use a table:

cooldown = { } -- Creates the table 
cooldown[thePlayer] = ... -- Assign a timer for a specific player (call this inside the function) 
if not isTimer(cooldown[thePlayer]) then --Check for a specific player 
    -- Check if a cooldown timer for a specific player not exist and does something 

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