Player connect
PHP Code:
#include <amxmodx>
#include <superheromod>
#define PLUGIN "Vip Connect"
#define VERSION "1.0"
#define AUTHOR "Bladell"
#define V1 "VIP I"
#define V2 "VIP II"
#define V3 "VIP III"
#define V4 "VIP IV"
#define V5 "VIP I, VIP II"
#define V6 "VIP I, VIP III"
#define V7 "VIP I, VIP IV"
#define V8 "VIP II, VIP III"
#define V9 "VIP II, VIP IV"
#define V10 "VIP III, VIP IV"
#define V11 "VIP I, VIP II, VIP III"
#define V12 "VIP I, VIP II, VIP IV"
#define V13 "VIP I, VIP III, VIP IV"
#define V14 "VIP II, VIP III, VIP IV"
#define V15 "all VIPs"
new g_iMsgSayText
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "message", "a", "1=0", "2=0")
g_iMsgSayText = get_user_msgid( "SayText" );
}
public message(id)
{
new pid
new playerCount
new players[SH_MAXSLOTS]
get_players(players, playerCount)
new name[32]
get_user_name(id, name, 31)
for ( new x = 0; x < playerCount; x++ )
{
pid = players[x]
}
new level = sh_get_user_lvl(pid)
static nums;
get_players(players, nums);
if( (get_user_flags(id) & ADMIN_LEVEL_B) )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V3, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_C) )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V2, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_D) )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V1, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_E) )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V4, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_C )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V8, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_D )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V6, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V10, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_C & ADMIN_LEVEL_D )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V5, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_C & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V9, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_D & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V7, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_C & ADMIN_LEVEL_D )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V11, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_C & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V13, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_D & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V14, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_C & ADMIN_LEVEL_D & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V12, level);
}
if( (get_user_flags(id) & ADMIN_LEVEL_B & ADMIN_LEVEL_C & ADMIN_LEVEL_D & ADMIN_LEVEL_E )
{
ChatColor(0, "^4[VIP]^1 %s with %s and level %d has joined the server", name, V15, level);
}
}
/*-----------------------------------------------------------------------------------*/
stock ChatColor(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, "!y", "^1")
replace_all(msg, 190, "!team", "^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, g_iMsgSayText, _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
I want when a VIP connect on server with specific flag to appear a message.But I have a problem when I need to check multiple flags, please help...
|