Raised This Month: $51 Target: $400
 12% 

Do something beetween 20:30 PM and 07:00 AM


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-08-2018 , 14:34   Do something beetween 20:30 PM and 07:00 AM
Reply With Quote #1

This is supposed to give vip to players for free beetween 200 PM and 7:00 AM.
But I don't know how to check if it's (for example) 20:46 PM or 01:04 AM

Can someone help me?
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <vip_core>
char g_Group[12] = "silver"

#pragma newdecls required

bool bIsEvent;


public 
void OnPluginStart()
{
    
CreateTimer(1.0Timer_Check_TIMER_REPEAT);
    
    
bIsEvent false;
}

public 
Action Timer_Check(Handle pTimer)
{
    
int iCurTime GetTime();
    
char sTime[128];
    
FormatTime(sTimesizeof(sTime), "%I:%M %p"iCurTime);
    
    if(
StrContains(sTime"22:30"false))
    {
        
PrintCenterTextAll("FREE VIP EVENT ON. RECONNECT TO GET FREE VIP");
        
        
bIsEvent true;
        
        
CreateTimer(46800.0Time_RemoveBool);
        
        for(
int iClient 1iClient <= MaxClientsiClient++)
        {
            
VIP_GiveClientVIP(-1iClient14400g_Grouptrue);
        }
    }
}

public 
Action Time_RemoveBool(Handle _Timer)
{
    
bIsEvent false;
}

public 
void OnClientPutInServer(int iClient)
{
    if(
bIsEvent)
    {
        if(!
VIP_IsClientVIP(iClient))
        {
            
VIP_GiveClientVIP(-1iClient14400g_Group);
            
PrintToChat(iClient"[TEST] VIP EVENT ON! YOU HAVE FREE VIP SILVER!");
        }
    }

__________________
kratoss1812 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode