Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include < amxmisc >
- const TASK_ID = 258;
- new h;
- new task_set = 0;
- new inceput;
- new sfarsit;
- public plugin_init()
- {
- register_plugin("Dam la saraci vip", "1.0", "cyby")
- inceput = register_cvar( "vip_start", "20" );
- sfarsit = register_cvar( "vip_end", "23" )
- }
- 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) != read_flags("t") || !( get_user_flags( id ) & ADMIN_LEVEL_H ) )
- {
- set_user_flags(id, read_flags("t"))
- 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 ) )
- {
- chat_color(id, "!t[FURIEN] !nEventul !tVIP SILVER FREE !na inceput !g!")
- }
- }
- public terminare(id)
- {
- new o, m, s;
- time(o, m, s)
- if(o == get_pcvar_num( sfarsit ) )
- {
- chat_color(id, "!t[FURIEN] !nEventul !tVIP SILVER FREE !as-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(256), random(256), random(256), 0.03, 0.03, 1, 1.0, 1.1, 0.1, 0.1, -1)
- show_hudmessage(0, "EVENT VIP SILVER FREE !")
- }
- }
- public mesaj(id)
- if( get_user_flags(id) != read_flags("t") || !( get_user_flags( id ) & ADMIN_LEVEL_H ) )
- {
- {
- chat_color(id, "!t[FURIEN] !nAi primit !tVIP SILVER !npentru ca este event !tVIP SILVER FREE !nintre orele!g %d:00 !nsi!g %d:00 !n!", get_pcvar_num( inceput ), get_pcvar_num( sfarsit ))
- }
- }
- stock chat_color(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[320]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4")
- replace_all(msg, 190, "!n", "^1")
- replace_all(msg, 190, "!t", "^3")
- replace_all(msg, 190, "!t2", "^0")
- 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()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement