Event VIP FREE

Cadet
  Avatar utilizator
Admin Server
Mesaje: 11
Membru din: Dum Ian 13, 2019 7:32 pm
Localitate: Arad
Been thanked: 1 time
Contact:

Event VIP FREE

Mesaj de Cadet » Dum Ian 13, 2019 9:57 pm

Descriere: Da un anumit flag playerilor intre anumite ore
Descarcare: -
Nume: Event VIP FREE
Versiune: 4.0
Autor: LOL

V4.0 |
Spoiler:
#include <amxmodx>
#include <amxmisc>

new start,
stop,
minutes,
h,
m

new bool: HaveVipBefore[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_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)) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}


Instalare:


1. Fisierul vip_free.sma il puneti in addons/amxmodx/scripting
2. Fisierul vip_free.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Cod: Selectaţi tot

vip_free.amxx

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):


vip_start - ora la care incepe eventul
vip_end - ora la care se termina

ATENTIE !! Cvarul vip_start nu trebuie sa fie mai mare decat cvarul vip_end

Flagul VIP il modificati in plugin la linia:

#define FLAGS "t"
M!CuTzu
  Avatar utilizator
Admin Server
Mesaje: 34
Membru din: Joi Dec 20, 2018 12:37 pm
Been thanked: 1 time

Re: Event VIP FREE

Mesaj de M!CuTzu » Lun Ian 14, 2019 3:20 pm

PRO, as zice ca VIPUL FREE sa fie seara intre orele 19:00-23:00
Members
Mesaje: 2
Membru din: Joi Ian 10, 2019 2:06 pm

Re: Event VIP FREE

Mesaj de CostiDosti » Mar Ian 15, 2019 2:29 pm

suubscriu
Scrie răspuns

Înapoi la “AmxModX Plugins”