Raised This Month: $32 Target: $400
 8% 

Free vip for all players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 09-12-2022 , 11:01   Free vip for all players
Reply With Quote #1

Can someone fix this pls ??!
I want it for all players in the sv ACCESS & FLAGS

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

new start,
stop,
minutes,
everyone,
m

new boolHaveVipBefore[33];

#define FLAGS ADMIN_ALL

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

public 
client_putinserver(id)
{
    
check(id)
}
public 
check(id)
{
    
    
timeeveryonem);
    new 
flags read_flags(FLAGS)
    
    if(
everyone >= 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();
            }
        }
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 09-12-2022 , 11:13   Re: Free vip for all players
Reply With Quote #2

this should work for everyone..
if not, try to put any flag, like ADMIN_LEVEL_H and use default flag "t" between those hours
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 09-12-2022 , 11:25   Re: Free vip for all players
Reply With Quote #3

Quote:
Originally Posted by Nutu_ View Post
this should work for everyone..
if not, try to put any flag, like ADMIN_LEVEL_H and use default flag "t" between those hours
Alright brooo !
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 09-12-2022 , 11:29   Re: Free vip for all players
Reply With Quote #4

Quote:
Originally Posted by Nutu_ View Post
this should work for everyone..
if not, try to put any flag, like ADMIN_LEVEL_H and use default flag "t" between those hours
Quote:
#include <amxmodx>
#include <amxmisc>

new start,
stop,
minutes,
h,
m

new bool: HaveVipBefore[33];

#default FLAGS "t"

public plugin_init()
{
register_plugin("VIP FREE", "4.0", "Fonix")

start = register_cvar( "vip_start", "00" );
stop = register_cvar( "vip_end", "23" );
minutes = register_cvar( "vip_minutes", "00" ); // nu modificati

set_task( 60.0, "check", _, _, _, "b" );

}

public client_putinserver(id)
{
check(id)
}
public check(id)
{

time( h, m, _ );
new flags = read_flags(FLAGS)

if(h >= get_pcvar_num( start ) && h < get_pcvar_num( stop ))
{
if(!(get_user_flags(id) & flags ))
{
set_user_flags(id, flags)
server_cmd( "amx_reloadadmins" );
HaveVipBefore[id] = false;
}else{
HaveVipBefore[id] = true;
}
if(h == get_pcvar_num( start ) && m == get_pcvar_num( minutes ))
{
ColorChat(0, "!g***** !tFREE VIP EVENT STARTED !g*****")
log_amx("***** FREE VIP EVENT STARTED *****")
}

set_hudmessage(random(256), random(256), random(256),0.02, 0.2, 1, _, 59.0, _, _, -1)
show_hudmessage(0, "** FREE VIP EVENT ACTIVE **")
}
else if(h < get_pcvar_num( start ) || h >= get_pcvar_num( stop ))
{
if (!(HaveVipBefore[id]))
{
remove_user_flags(id, flags);
server_cmd( "amx_reloadadmins" );
}
if(h == get_pcvar_num( stop ) && m == get_pcvar_num( minutes ))
{
ColorChat(0, "!g***** !tFREE VIP EVENT ENDED !g*****")
log_amx("***** FREE VIP EVENT ENDED *****")
}
}
}

stock ColorChat(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, "!n", "^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();
}
}
}
}

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Unknown directive on line 12
Error: Undefined symbol "FLAGS" on line 34

2 Errors.
Could not locate output file D:\AMX Mod X\amxxstudio\Untitled.amx (compile failed).
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 09-12-2022 , 11:48   Re: Free vip for all players
Reply With Quote #5

not like this, #define FLAGS ADMIN_LEVEL_H
go to amxx.cfg and change amx_default_access "t"
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 21:20.


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