- Código:
Comandos: /vipmenu
Oque esse plugin faz?
R:. Abre um menu para VIP'S.
Exemplo:
[Play Team] Menu VIP:
1. Kickar Jogador
2. Transferir jogador de Time
SMA:
- Código:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Jb Menu VIP"
#define VERSION "1.0"
#define AUTHOR "[S]layer"
#define Flags ADMIN_ALL
#define MAX_PLAYERS 32
new g_menuposition[MAX_PLAYERS+1]
new g_menuplayers[MAX_PLAYERS+1][32]
new g_menuplayersnum[MAX_PLAYERS+1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /vipmenu", "menuVIP1")
register_menucmd(register_menuid("Kick Menu"), 1023, "caseKICK")
register_menucmd(register_menuid("Tranfer Menu"), 1023, "caseTranfer")
}
public menuVIP1(id)
{
if (!(get_user_flags( id )&ADMIN_RESERVATION)){
ChatColor(id,"Voce nao tem acesso a esse menu")
client_print(id, print_center, "Somente VIPs pode acessa esse menu")
return PLUGIN_HANDLED;
}
new menu32[ 256 ]
formatex(menu32, 255, "~> Play Team VIP Menu <~")
new menu35 = menu_create(menu32,"caseMENU")
menu_additem(menu35,"Kickar Jogador","1")
menu_additem(menu35,"Transferir jogador de time","2")
menu_display(id, menu35, 0)
menu_setprop(menu35, MPROP_EXIT, MEXIT_ALL)
return PLUGIN_CONTINUE
}
public caseMENU( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new szname[ 33 ]
get_user_name(id, szname,charsmax( szname ))
new data[6], iName[64];
new iaccess, callback;
menu_item_getinfo(menu, item, iaccess, data,4, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1: menuKICK(id, g_menuposition[id] = 0)
case 2: menuTranfe(id, g_menuposition[id] = 0)
}
return PLUGIN_CONTINUE;
}
menuKICK(id, pos)
{
get_players(g_menuplayers[id], g_menuplayersnum[id])
static menubody[512]
new len = format(menubody, 511, "\wKick Menu^n^n")
if(pos < 0)
return
new start = pos * 8
if(start >= g_menuplayersnum[id])
start = pos = g_menuposition[id]
new end = start + 8
if(end > g_menuplayersnum[id])
end = g_menuplayersnum[id]
static name[32]
new b = 0, i
new keys = MENU_KEY_0
for(new a = start; a < end; ++a)
{
i = g_menuplayers[id][a]
get_user_name(i, name, 31)
if(i == id)
{
++b
len += format(menubody[len], 511 - len, "\r# %s \d%s^n", name, name ? "( Seu Nome )" : "")
}
else
{
keys |= (1<<b)
len += format(menubody[len], 511 - len, "\y%d. \w%s.\w^n",++b, name)
}
}
if(end != g_menuplayersnum[id])
{
format(menubody[len], 511 - len, "^n9. %s...^n0. %s", "Avancar", pos ? "Voltar" : "Sair")
keys |= MENU_KEY_9
}
else
format(menubody[len], 511-len, "^n0. %s", pos ? "Voltar" : "Sair")
show_menu(id, keys, menubody, -1, "Kick Menu")
}
public caseKICK(id, key)
{
switch(key)
{
case 8: menuKICK(id, ++g_menuposition[id])
case 9: menuKICK(id, --g_menuposition[id])
default:
{
new player = g_menuplayers[id][g_menuposition[id] * 8 + key]
menuKICK(id, g_menuposition[id])
static name[32]
get_user_name(player, name, 31)
ChatColor(id, "Voce kikou jogador %s", name)
server_cmd( "kick #%d ^"Chutado do servidor^"", get_user_userid( player ))
new szname[32]
get_user_name(Flags,szname,31)
ChatColor(0, "!yJogador VIP !g%s !ydeu kick no player !t%s",szname, name)
}
}
return PLUGIN_CONTINUE
}
menuTranfe(id, pos)
{
get_players(g_menuplayers[id], g_menuplayersnum[id])
static menubody[512]
new len = format(menubody, 511, "\wTranfer Menu^n^n")
if(pos < 0)
return
new start = pos * 8
if(start >= g_menuplayersnum[id])
start = pos = g_menuposition[id]
new end = start + 8
if(end > g_menuplayersnum[id])
end = g_menuplayersnum[id]
static name[32]
new b = 0, i
new keys = MENU_KEY_0
for(new a = start; a < end; ++a)
{
i = g_menuplayers[id][a]
get_user_name(i, name, 31)
if(i == id)
{
++b
len += format(menubody[len], 511 - len, "\r# %s \d%s^n", name, name ? "( Seu Nome )" : "")
}
else
{
if(cs_get_user_team( i )== CS_TEAM_CT)
{
keys |= (1<<b)
len += format(menubody[len], 511 - len, "\y%d. \w%s \d( CT ).\w^n",++b, name)
}
if(cs_get_user_team( i )== CS_TEAM_T)
{
keys |= (1<<b)
len += format(menubody[len], 511 - len, "\y%d. \w%s \D( TR ).\w^n",++b, name)
}
}
}
if(end != g_menuplayersnum[id])
{
format(menubody[len], 511 - len, "^n9. %s...^n0. %s", "Avancar", pos ? "Voltar" : "Sair")
keys |= MENU_KEY_9
}
else
format(menubody[len], 511-len, "^n0. %s", pos ? "Voltar" : "Sair")
show_menu(id, keys, menubody, -1, "Tranfer Menu")
}
public caseTranfer(id, key)
{
switch(key)
{
case 8: menuTranfe(id, ++g_menuposition[id])
case 9: menuTranfe(id, --g_menuposition[id])
default:
{
new player = g_menuplayers[id][g_menuposition[id] * 8 + key]
menuTranfe(id, g_menuposition[id])
new szname[32]
get_user_name(Flags,szname,31)
static name[32]
get_user_name(player, name, 31)
ChatColor(id, "Voce mudou o time do jogador !g%s", name)
if(cs_get_user_team( player ) == CS_TEAM_T)
{
cs_set_user_team(player, CS_TEAM_CT)
user_kill(player)
ChatColor(0, "!yJogador VIP !g%s !ytranferiu o jogador !t%s !ypara CT",szname, name)
}
else
{
cs_set_user_team( player, CS_TEAM_T)
user_kill(player)
ChatColor(0, "!yJogador VIP !g%s !ytranferiu o jogador !t%s !ypara TR",szname, name)
}
}
}
}
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") // Chat Verde
replace_all(msg, 190, "!y", "^1") // Chat Normal
replace_all(msg, 190, "!t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
replace_all(msg, 190, "!t2", "^0") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
}