#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#define PLUGIN "[FREE VIP] Time"
#define VERSION "1.0"
#define AUTHOR "Overpack"
/*==========================================================================
[CVARS]
==========================================================================*/
new g_FreeVip[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "PlayerSpawnPost", 1)
}
public PlayerSpawnPost(id)
{
new szTime[3]
get_time("%H", szTime, sizeof(szTime))
new iTime = str_to_num(szTime)
if(22 <= iTime <= 10)
{
if(get_user_flags(id) & ADMIN_RESERVATION)
{
g_FreeVip[id] = false
}
else
{
remove_user_flags(id, ADMIN_USER)
set_user_flags(id, ADMIN_LEVEL_H)
set_hudmessage(42, 255, 0, 0.30, 0.25, 0, 6.0, 12.0)
show_hudmessage(id, "[VIP] All players get VIP from 22:00 to 10:00.")
g_FreeVip[id] = true
}
}
else if(g_FreeVip[id])
{
remove_user_flags(id, ADMIN_LEVEL_H)
set_user_flags(id, ADMIN_USER)
g_FreeVip[id] = false
}
}
/*
stock echo_colored( id, string[ ], any:... )
{
new szmsg[ 192 ];
vformat( szmsg, charsmax( szmsg ), string, 3 );
replace_all( szmsg, charsmax( szmsg ), "!y", "^x01" );
replace_all( szmsg, charsmax( szmsg ), "!t", "^x03" );
replace_all( szmsg, charsmax( szmsg ), "!g", "^x04" );
message_begin( MSG_ONE, g_msgid_SayText, { 0,0,0 }, id );
write_byte( id );
write_string( szmsg );
message_end( );
}
*/