Jump to content
Sign in to follow this  
marvel_team

[REZOLVAT] VIP_free

Recommended Posts

Nume :VIP FREE

Versiune : nu conteaza

Descriere : 

-Doresc un plugin de tip VIP care sa ofere vip tuturor jucatorilor dupa server intr-un anumit interval de timp , adica intre 19:00 si 23:00.Meniu simplu , AK+Deagle / M4a1 + Deagle. Eu am un plugin de vip activat , trebuie sa-l dezactivez ?si va rog sa-mi raspundeti si la ultimul post daca se poate

Share this post


Link to post
Share on other sites
#include <amxmodx>

#include < amxmisc >

 

const TASK_ID = 258;

 

new task_set = 0;

new inceput,

    sfarsit,

    flag_vip,

h

 

public plugin_init()

{

register_plugin("free_vip", "2.0", "brick-bazuka // editat de marvel_team")

 

inceput = register_cvar( "vip_start", "19" );

sfarsit = register_cvar( "vip_end", "22" )

flag_vip = register_cvar( "vip_flag", "131072" )

 

}

 

public client_putinserver(id)

{

new o, m, s;

time(o, m, s)

if(o >= get_pcvar_num( inceput ) && o < get_pcvar_num( sfarsit ))

{

if( get_user_flags(id) != get_pcvar_num( flag_vip ) || !( get_user_flags( id ) & get_pcvar_num( flag_vip ) ) )

{

set_user_flags(id, get_pcvar_num( flag_vip ))

set_task(3.0, "mesaj", id)

set_task(1.0, "hud_mess", _, _, _, "b")

set_task(60.0, "incepe", id)

set_task(60.0, "terminare", id)

}

if( !task_set )

{

set_task( 60.0, "recheck", TASK_ID, _, _, "b" ); // task pus la 1 minut pentru a functiona corect

task_set = 1;

}

}

}

public recheck()

{

 

time( h, _, _ );

 

if( h >= 23 )

{

new iPlayers[ 32 ], iNum, i;

get_players( iPlayers, iNum );

 

for( i = 0; i < iNum; i++ )

{

remove_user_flags( iPlayers[ i ] );

}

 

server_cmd( "amx_reloadadmins" );

 

remove_task( TASK_ID );

task_set = 0;

}

}

public incepe(id)

{

new o, m, s;

time(o, m, s)

if(o == get_pcvar_num( inceput ) )

ColorChat(id, "!t[Marvel] !nEventul!t VIP Acces FREE !na inceput !g!")

}

public terminare(id)

{

new o, m, s;

time(o, m, s)

if(o == get_pcvar_num( sfarsit ) )

ColorChat(id,  "!t[Marvel] !nEventul!t VIP Acces FREE !ns-a terminat !g!")

}

public hud_mess()

{

new o, m, s;

time(o, m, s)

if(o >= get_pcvar_num( inceput ) && o < get_pcvar_num( sfarsit ))

{

 

set_hudmessage(random(0), random(255), random(0), 0.00, 0.17, 1, 1.0, 1.0, 0.1, 0.1)

show_hudmessage(0, "Event Free VIP !")

}

}

public mesaj(id)

{

       if( get_user_flags(id) != get_pcvar_num( flag_vip ) || !( get_user_flags( id ) & get_pcvar_num( flag_vip ) ) )

{

 

ColorChat(id, "!t[Marvel]!nAi primit!t VIP Acces !npentru ca este event!t VIP Acces Free !nintre orele!g %d:00 !nsi!g %d:00 !n!", get_pcvar_num( inceput ), get_pcvar_num( sfarsit ))

 

}

}

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();

}

}

}

}

Share this post


Link to post
Share on other sites


#include <amxmodx>

 

new const TAG[] = "[TAG]";

 

new bool:vip_free, g_msg_saytext;

 

public plugin_init()

{

register_plugin("Free VIP Giver", "2.0", "cyby")

check_time()

set_task(60.0, "check_time", _, _, _, "b")

set_task(1.0, "hud_mess", _, _, _, "b")

 

g_msg_saytext = get_user_msgid("SayText");

}

 

public check_time()

{

static preluare_ora[3], ora;

get_time("%H", preluare_ora, 2)

ora = str_to_num(preluare_ora)

if(21 >= ora || ora < 11)

{

if(!vip_free)

color(0, ".v%s.g Eventul.e Free VIP.g a fost activat!", TAG)

vip_free = true

server_cmd("amx_default_access ^"t^"")

}

else

{

if(vip_free)

color(0, ".v%s.g Eventul.e Free VIP.g a fost dezactivat!", TAG)

vip_free = false

server_cmd("amx_default_access ^"z^"")

}

server_cmd("amx_reloadadmins")

}

 

public hud_mess()

{

if(vip_free)

{

set_hudmessage(random(256), random(256), random(256), 0.00, 0.17, 1, 1.0, 1.0, 0.1, 0.1)

show_hudmessage(0, "Event V.I.P Free !")

}

}

 

stock color(const id, const input[], any:...)

{

new count = 1, players[32]

static msg[191]

vformat(msg, 190, input, 3)

 

replace_all(msg, 190, ".v", "^4")

replace_all(msg, 190, ".g", "^1")

replace_all(msg, 190, ".e", "^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, g_msg_saytext, _, players)

write_byte(players);

write_string(msg);

message_end();

}

}

}

}

Editezi ora , dupa bunul plac :

if(21 >= ora || ora < 11)

Share this post


Link to post
Share on other sites

L-am gasit si eu la ciby si l-am ediat corespunzator :D

multumesc.asta merge fara cvar`uri.

Pluginurile care nu folosesc module nu genereaza lag

merge perfect.multumesc

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...