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

Free VIP code.


Post New Thread Reply   
 
Thread Tools Display Modes
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 14:04   Re: Free VIP code.
Reply With Quote #11

This is it, try this now
PHP Code:
public Spawn(id

    new 
hour 
    time
(hour
    
    if(
21 <= hour || hour 9
    { 
        
Ads[id] = true 
        
        
if(get_user_flags(id) & ADMIN_USER && !HappyHour[id]) 
        {
            
HappyHour[id] = true 
            remove_user_flags
(idADMIN_USER
            
set_user_flags(idADMIN_LEVEL_C
            
            if(
Ads[id]) 
            { 
                
set_hudmessage(02550, -1.0, -1.016.05.00.52.0
                
show_hudmessage(id"Happy Hour is ON! Enjoy Free VIP :)"
            } 
        } 
        
        else if(
get_user_flags(id) & ADMIN_KICK
        { 
            if(
get_user_flags(id) & ADMIN_LEVEL_C
            { 
                return 
PLUGIN_CONTINUE 
            

            else 
            { 
                
set_user_flags(idADMIN_LEVEL_C
                
                if(
Ads[id]) 
                { 
                    
set_hudmessage(02550, -1.0, -1.016.05.00.52.0
                    
show_hudmessage(id"Happy Hour is ON! Enjoy Free VIP :)"
                } 
                
                
AdminHappyHour[id] = true 
            

        } 
        
    } 
    else 
    { 
        if(
HappyHour[id]) 
        {
            if(
get_user_flags(id) & ADMIN_LEVEL_C
            { 
                
remove_user_flags(idADMIN_LEVEL_C
                                
set_user_flags(idADMIN_USER)
                
                if(
Ads[id]) 
                { 
                    
set_hudmessage(25500, -1.0, -1.016.05.00.52.0
                    
show_hudmessage(id"Happy Hour is OFF! :)"
                } 
            } 
            
HappyHour[id] = false 
        

        else if(
AdminHappyHour[id]) 
        { 
            if(
get_user_flags(id) & ADMIN_LEVEL_C
            { 
                
remove_user_flags(idADMIN_LEVEL_C
                
                if(
Ads[id]) 
                { 
                    
set_hudmessage(25500, -1.0, -1.016.05.00.52.0
                    
show_hudmessage(id"Happy Hour is OFF! :)"
                    
                    
Ads[id] = false 
                

            } 
            
AdminHappyHour[id] = false 
        

    } 


Last edited by TheWhitesmith; 11-22-2017 at 14:06.
TheWhitesmith is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 14:07   Re: Free VIP code.
Reply With Quote #12

And type thetime, and tell me how much is it and what is your local time
TheWhitesmith is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-22-2017 , 14:13   Re: Free VIP code.
Reply With Quote #13

Quote:
Originally Posted by Str4x3D1x View Post
i'll need your include file...
Aren't you aware of the include file I attached to my last post?
__________________
edon1337 is offline
Str4x3D1x
Member
Join Date: Feb 2014
Old 11-22-2017 , 14:44   Re: Free VIP code.
Reply With Quote #14

Hmmm

PHP Code:
public Spawn(id)
{
    new 
hour
    time
(hour)

    if(
21 <= hour || hour 9)
    {
        
Ads[id] = true

        
if(get_user_flags(id) & ADMIN_USER && !HappyHour[id])
        {
            
HappyHour[id] = true
            remove_user_flags
(idADMIN_USER)
            
set_user_flags(idADMIN_LEVEL_C)
            
            if(
Ads[id])
            {
                
set_hudmessage(02550, -1.0, -1.016.05.00.52.0)
                
show_hudmessage(id"Happy Hour is ON! Enjoy Free VIP :)")
            }
        }
        
        else if(
get_user_flags(id) & ADMIN_KICK)
        {
            if(
get_user_flags(id) & ADMIN_LEVEL_C)
            {
                return 
PLUGIN_CONTINUE
            
}
            else
            {
                
set_user_flags(idADMIN_LEVEL_C)
                
                if(
Ads[id])
                {
                    
set_hudmessage(02550, -1.0, -1.016.05.00.52.0)
                    
show_hudmessage(id"Happy Hour is ON! Enjoy Free VIP :)")
                }
                
                
AdminHappyHour[id] = true
            
}
        }
    }
    else
    {
        if(
HappyHour[id])
        {
            if(
get_user_flags(id) & ADMIN_LEVEL_C)
            {
                
remove_user_flags(idADMIN_LEVEL_C)
                
set_user_flags(idADMIN_USER)

                if(
Ads[id])
                {
                    
set_hudmessage(25500, -1.0, -1.016.05.00.52.0)
                    
show_hudmessage(id"Happy Hour is OFF! :)")
                }
            }
        }
        
HappyHour[id] = false
    
}
    else if(
AdminHappyHour[id])
    {
        if(
get_user_flags(id) & ADMIN_LEVEL_C)
        {
            
remove_user_flags(idADMIN_LEVEL_C)
                
            if(
Ads[id])
            {
                
set_hudmessage(25500, -1.0, -1.016.05.00.52.0)
                
show_hudmessage(id"Happy Hour is OFF! :)")

                
Ads[id] = false
            
}
        }
        
AdminHappyHour[id] = false
    

PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Invalid expressionassumed zero on line 283
Warning
Expression has no effect on line 283
Error
Expected token";"but found "if" on line 283

2 Errors





EDIT: Line 283 is

PHP Code:
else if(AdminHappyHour[id]) 
EDIT2: Yes, I'm checking time on server by typing thetime and it's around 15 min behind my local time but that's not that important.
__________________
First you learn to read. Then you read to learn.

Last edited by Str4x3D1x; 11-22-2017 at 14:51.
Str4x3D1x is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 14:53   Re: Free VIP code.
Reply With Quote #15

Use my version
TheWhitesmith is offline
Str4x3D1x
Member
Join Date: Feb 2014
Old 11-22-2017 , 15:07   Re: Free VIP code.
Reply With Quote #16

Interesting, just around time. This does work but few bugs:

Prefix saying that Free VIP is on doesn't appear, also it seems like when someone connects to server, it removes old vips and gives it over again to everyone on the next round. (I was testing with /vips).

It was like VIPs Online: blabla, bla, tests

When someone connected (qwe)

VIPs Online: qwe

Next round

VIPs Online: blabla, bla, tests, qwe

Nothing in logs tho...
__________________
First you learn to read. Then you read to learn.
Str4x3D1x is offline
mrjk990
Junior Member
Join Date: Oct 2016
Old 05-05-2020 , 15:53   Re: Free VIP code.
Reply With Quote #17

Quote:
Originally Posted by edon1337 View Post
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 ) )

thanks for sharing this plugin , and thanks to OciXCrom too

but how to check player before give to him a vip
like spec bots plugin :https://forums.alliedmods.net/showpo...80&postcount=6
when the bot logged in to server he will have a vip too
__________________


mrjk990 is offline
Reply



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


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