View Single Post
Author Message
Shitty
Member
Join Date: Sep 2019
Old 01-13-2020 , 13:12   Free-vip for all [EVENT]
Reply With Quote #1

I have a plugin that's called free_vip.sma, it's plugin which give a free VIP for anyone connect server.. (flags "bn"), but i only want it to work from 8.30 PM to 8.30 AM, can someone make this for me?

Code:
#include <amxmodx>  

public plugin_init()   
{  
    register_plugin( "Free VIP" , "1.0" , "Someone" );  
} 

public client_putinserver( id ) 
{ 
    if ( get_user_flags( id ) & ADMIN_USER )  
    { 
        remove_user_flags( id , ADMIN_USER );  
        set_user_flags( id , read_flags( "bn" ) );  
        set_task( 3.0, "task_adv", id )  
    } 
    else 
        if ( get_user_flags( id ) & (1 << 22) )  
    { 
        remove_user_flags( id , (1 << 22) );  
        set_user_flags( id , read_flags( "bn" ) );  
        set_task( 3.0, "task_adv", id )  
    } 
    return PLUGIN_CONTINUE;  
} 

public task_adv( id ) 
{ 
    client_chat( id , "!gHappy Time, you got free VIP !!" )  
} 

stock client_chat( const id , const input[] , any:... )  
{  
    new count = 1, players[ 32 ];  
    static msg[ 191 ]; vformat( msg, 190, input, 3 );  
     
    replace_all( msg, 190, "!g", "^4" );  
    replace_all( msg, 190, "!y", "^1" );  
    replace_all( msg, 190, "!t", "^3" );  
     
    if( id ) players[ 0 ] = id; else get_players( players,count,"ch" );  
    for ( new i=0;i<count;i++ )  
    {  
        if( is_user_connected( players[ i ] ) )  
        {  
            message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );  
            write_byte( players[ i ] );  
            write_string( msg ) ;  
            message_end( );  
        }  
    }  
}
__________________

Last edited by Shitty; 01-13-2020 at 13:16.
Shitty is offline