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

Free vip happy hours


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apb hq
Senior Member
Join Date: Apr 2014
Old 12-23-2018 , 06:44   Free vip happy hours
Reply With Quote #1

Hi guys can someone make a plugin which will give between 21 and 11 oclock ADMIN_MENU flag to players who have ADMIN_USER access and between 23 and 10 players with ADMIN_MENU or ADMIN_USER will get ADMIN_LEVEL_H and ADMIN_MENU flags

I don't need task scheduler i need a separate plugin

thanks in advance
Apb hq is offline
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 12-24-2018 , 06:41   Re: Free vip happy hours
Reply With Quote #2

Code:
#include <amxmodx>

#define HP_TASK 543221588

new HappyHourStart,HappyHourStop,maxplayers,HappyHour;

new bool:is_happy_hour;

new Float:HP_RATE,cvar_hp_rate
new szFlags[ 33 ];


public plugin_init()
{	
    HappyHour = register_cvar("happy_hour", "1")
    HappyHourStart = register_cvar("happy_hour_start", "21.00")
    HappyHourStop = register_cvar("happy_hour_end", "11.00")
    
    cvar_hp_rate = register_cvar("happy_hour_rate","10.0")

    HappyHourCheck(HP_TASK)
    update_cvars()
    maxplayers = get_maxplayers();
}

public update_cvars()
{
	HP_RATE = get_pcvar_float(cvar_hp_rate)
}

public HappyHourCheck(taskid)
{
	if(get_pcvar_num(HappyHour) == 1)
	{
		is_happy_hour = true;
	}
	else if(get_pcvar_num(HappyHour) == 0)
	{
		is_happy_hour = false;
	}
	new data[3]
	get_time("%H", data, 2)
	new Hours = str_to_num(data) //time(Hours);
	new BeginHour = get_pcvar_num(HappyHourStart);
	new EndHour  = get_pcvar_num(HappyHourStop);

	if(BeginHour == EndHour || EndHour == Hours)
	{
		is_happy_hour = false;
	}
		
	else if( EndHour> Hours >= BeginHour)
	{
		is_happy_hour = true;
			
	}
	else
	{
		is_happy_hour = false;
	}
	if(is_happy_hour)
	{
            for(new id;id < maxplayers;id++)
            {
                set_user_flags(id, read_flags("abcdefghijklmnopqrstu"))

                //client_print(0,print_console,"DEBUG: TEXT SET (TRUE)")
            }
	}
	else
	{
            for(new id;id < maxplayers;id++)
            {
                szFlags[ id ] = get_user_flags( id );
                remove_user_flags( id );

                //client_print(0,print_console,"DEBUG: TEXT SET (FALSE)")
            }
	}
        set_task(HP_RATE,"HappyHourCheck",HP_TASK)
}

Last edited by Saint Sinner; 12-24-2018 at 08:29.
Saint Sinner is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 12-24-2018 , 09:15   Re: Free vip happy hours
Reply With Quote #3

This plugin doesn’t do what i have requested
Apb hq is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 03-14-2019 , 10:00   Re: Free vip happy hours
Reply With Quote #4

Bump
Apb hq 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:50.


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