Thread: Free VIP code.
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-21-2017 , 17:59   Re: Free VIP code.
Reply With Quote #5

Credits to OciXCrom for his IsVipHour bool stock.
PHP Code:
#include < amxmodx >
#include < engine >
#include < hamsandwich >

#define VIP_FLAG ADMIN_LEVEL_H

new g_iCvars];

new 
bool:g_bFreeVipTime;

public 
plugin_init( )
{
    
register_plugin"Free VIP""1.0""DoNii" );

    
register_event"HLTV""OnNewRound""a""1=0""2=0" );
    
    
g_iCvars] = register_cvar"free_vip_on""1" );
    
g_iCvars] = register_cvar"free_vip_start_time""22" );
    
g_iCvars] = register_cvar"free_vip_end_time""10" );
}

public 
plugin_natives( )
{
    
register_library"free_vip" );
    
register_native"is_free_vip_time""native_is_free_vip_time");
}

public 
client_PostThinkid )
{
    if( 
g_bFreeVipTime )
    {
        
set_user_flagsidVIP_FLAG );
    }
}

public 
OnNewRound( )
{
    if( ! 
get_pcvar_numg_iCvars] ) )
    return 
PLUGIN_CONTINUE;

    if( 
IsVipHourget_pcvar_numg_iCvars] ), get_pcvar_numg_iCvars] ) ) )
    
g_bFreeVipTime true;
    
    else
    
g_bFreeVipTime false;
    
    return 
PLUGIN_CONTINUE;
}

public 
native_is_free_vip_timeiPluginiParams )
{
    return 
g_bFreeVipTime;
}

bool:IsVipHouriStartiEnd )
{
    new 
iHourtimeiHour );
    return 
bool:( iStart iEnd ? ( iStart <= iHour iEnd ) : ( iStart <= iHour || iHour iEnd ) )

Attached Files
File Type: inc free_vip.inc (111 Bytes, 858 views)
__________________

Last edited by edon1337; 06-27-2018 at 12:35.
edon1337 is offline