Raised This Month: $79 Target: $400
 19% 

Plugin Event VIP FREE [UPDATE - V4.0]


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-31-2019 , 11:11   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #11

Better way

PHP Code:
#include < amxmodx >
#include < amxmisc > 
#include < engine >
#include < hamsandwich >

#define MAX_PLAYERS         32
#define VIP_FLAG            ADMIN_LEVEL_H
#define PLUGIN_VERSION      "1.2"

new g_iCvars];

new 
bool:g_bFreeVipTimebool:g_bAlreadyVipMAX_PLAYERS ];

new 
g_iCacheFlagsMAX_PLAYERS ];

const 
g_iFlagsBitsum = ( VIP_FLAG // you can add multiple flags ( VIP_FLAG | FLAG_1 | FLAG_2 )

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

    
register_cvar"free_vip_version"PLUGIN_VERSIONFCVAR_SERVER FCVAR_SPONLY FCVAR_UNLOGGED )
    
    
register_event"HLTV""OnNewRound""a""1=0""2=0" );

    
RegisterHamHam_Spawn"player""fw_HamSpawnPost");
    
    
g_iCvars] = register_cvar"free_vip_on""1" );
    
g_iCvars] = register_cvar"free_vip_start_time""15" );
    
g_iCvars] = register_cvar"free_vip_end_time""22" );
}

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

public 
native_is_free_vip_timeiPluginiParams )
{
    return 
g_bFreeVipTime;
}

public 
client_putinserverid )
{
    
g_bAlreadyVipid ] = ( get_user_flagsid ) & VIP_FLAG ) ? true false;
}

public 
client_disconnectid )
{
    
ResetFlagsToDefaultid );
    
    
g_bAlreadyVipid ] = false;
    
g_iCacheFlagsid ] = 0;
}

public 
OnNewRound( )
{
    if( ! 
get_pcvar_numg_iCvars] ) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    
g_bFreeVipTime IsVipHourget_pcvar_numg_iCvars] ), get_pcvar_numg_iCvars] ) );
    
    return 
PLUGIN_CONTINUE;
}

public 
fw_HamSpawnPostid )
{
    if( ! 
is_user_aliveid ) || is_user_botid ) || ! get_pcvar_numg_iCvars] ) )
    return 
HAM_IGNORED;
    
    if( 
g_bFreeVipTime )
    {
        if( 
get_user_flagsid ) & ADMIN_USER && ! g_bAlreadyVipid ] )
        {
            
g_iCacheFlagsid ] = get_user_flagsid ); // cache his flags
            
SetVipFlagid );
        }
    }
    
    else
    {
        if( ! 
g_bAlreadyVipid ] && ( get_user_flagsid ) & VIP_FLAG ) )
        {
            
ResetFlagsBackid ); // time expired so should the flag
        
}
    }    
    return 
HAM_IGNORED;
}

ResetFlagsToDefaultid )
{
    
remove_user_flagsid )
    
set_user_flagsidADMIN_USER );
}

ResetFlagsBackid )
{
    
remove_user_flagsid );    
    
set_user_flagsidg_iCacheFlagsid ] );
}

SetVipFlagid )
{
    if( 
get_user_flagsid ) & ADMIN_USER )
    {
        
remove_user_flagsidADMIN_USER );
    }
    
set_user_flagsidg_iFlagsBitsum );
}

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

__________________

Last edited by edon1337; 09-02-2019 at 14:01.
edon1337 is offline
Send a message via Skype™ to edon1337
Gulden
New Member
Join Date: May 2020
Old 05-23-2020 , 12:46   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #12

Quote:
Originally Posted by FonixPro20 View Post
Hello All,

Plugin Event VIP FREE [UPDATE - V4.0]

Time 20 - 23 Change It If You Want .

PHP Code:
#include <amxmodx>
#include <amxmisc>

new start,
stop,
minutes,
h,
m

new boolHaveVipBefore[33];

#define FLAGS "t"

public plugin_init()
{
    
register_plugin("VIP FREE""4.0""LOL")
    
    
start register_cvar"vip_start""20" );
    
stop register_cvar"vip_end""23" );
    
minutes register_cvar"vip_minutes""00" ); // nu modificati
    
    
set_task60.0"check"___"b" );
    
}

public 
client_putinserver(id)
{
    
check(id)
}
public 
check(id)
{
    
    
timehm);
    new 
flags read_flags(FLAGS)
    
    if(
>= get_pcvar_numstart ) && get_pcvar_numstop ))
    {        
        if(!(
get_user_flags(id) & flags ))
        {
            
set_user_flags(idflags)
            
server_cmd"amx_reloadadmins" );
            
HaveVipBefore[id] = false;
            }else{
            
HaveVipBefore[id] = true;
        }
        if(
== get_pcvar_numstart ) && == get_pcvar_numminutes ))
        {
            
ColorChat(0"!g***** !tFREE VIP EVENT STARTED !g*****")
            
log_amx("***** FREE VIP EVENT STARTED *****")
        }
        
        
set_hudmessage(random(256), random(256), random(256),0.020.21_59.0__, -1)
        
show_hudmessage(0"** FREE VIP EVENT ACTIVE **")
    }
    else if(
get_pcvar_numstart ) || >= get_pcvar_numstop ))
    {
        if (!(
HaveVipBefore[id]))
        {
            
remove_user_flags(idflags);
            
server_cmd"amx_reloadadmins" );
        }
        if(
== get_pcvar_numstop ) && == get_pcvar_numminutes ))
        {
            
ColorChat(0"!g***** !tFREE VIP EVENT ENDED !g*****")
            
log_amx("***** FREE VIP EVENT ENDED *****")
        }
    }
}

stock ColorChat(const id, const input[], any:...) {
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4");
    
replace_all(msg190"!n""^1");
    
replace_all(msg190"!t""^3");
    
    if(
idplayers[0] = id;
    else 
get_players(playerscount"ch"); {
        for(new 
0counti++) {
            if(
is_user_connected(players[i])) {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

Thanks All .

I don't know why I don't like the VIP event !! I put flags from the VIP that I have on the server and it doesn't work for me !! can someone help me too !! I have "br" flags on vip and I would like it to be set from 7 pm to 11 pm
__________________
Gulden-Cs.Sladers.Ro !!
Gulden is offline
Mohamed null
Senior Member
Join Date: Sep 2020
Location: Algeria
Old 09-23-2020 , 15:54   Re: Plugin Event VIP FREE [UPDATE - V4.0]
Reply With Quote #13

Pls Tell me
How to add Items :
Models Menu
Knifes Menu
Glow Menu
Golden Deagle
Buy Bomb
Health Shop
----------
I HAVE Golden Deagle mdl + Glow Menu + Knifes menu models + Models menu
PLS MAKE IT FOR ME GUYS !!!
Mohamed null is offline
Reply


Thread Tools
Display Modes

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 02:31.


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