Menu de Ultiltarios
Funcao: Adiciona um menu para os Jogadores mais novatos, executarem comandos ex:
cl_minmodels, rates, e etc..
Vou disponibilizar o menu de informacoes e o Menu de Visao Noturna em outros topicos.
- Código:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Ultilitarios para ZombiePlague"
#define VERSION "0.1"
#define AUTHOR "TheTNT"
public plugin_init()
{
register_clcmd( "say /ultilitarios","Menu")
}
public Menu(id)
{
new menu = menu_create("\r-=[ \wUltilitarios ZombiePlague \r]=-", "menu_handler")
menu_additem(menu, "Desativar Skins\r[\dSkins Originais do CS\r]", "1", 0)
menu_additem(menu, "Ativar Skins\r[\dSkins Originais do Servidor\r]", "2", 0)
menu_additem(menu, "Ajustar Rates\r[\dDiminua seu Ping\r]", "3", 0)
menu_additem(menu, "Mudar cor da Visao Noturna\r[\dEscolha a Cor\r]", "4", 0)
menu_additem(menu, "Mudar cor da Lanterna\r[\dEscolha a Cor\r]", "5", 0)
menu_additem(menu, "Contato\r[\dFormas de Comunicacao\r]", "6", 0)
menu_additem(menu, "Informacoes\r[\dTire suas Duvidas\r]", "7", 0)
menu_setprop(menu, MPROP_EXITNAME, "Sair")
menu_display(id, menu, 0)
}
public menu_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_cmd(id, "cl_minmodels 1")
}
case 2:
{
client_cmd(id, "cl_minmodels 0")
}
case 3:
{
client_cmd(id, "rate 25000")
client_cmd(id, "cl_cmdrate 50")
client_cmd(id, "cl_updaterate 50")
}
case 4:
{
client_cmd(id, "say /humanonight")
}
case 5:
{
client_cmd(id, "say /lanternanight")
}
case 6:
{
client_cmd(id, "say /contato")
}
case 7:
{
client_cmd(id, "say /informacoes")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}