Post by tousif on Jan 9, 2015 12:08:27 GMT
I Have A plugin .amxx not sma so icould not add menu in it So i am making another plugin that make a menu and that menu consists players name (example: kick or ban menu) and when i select player name the command is executed on that particular player ADd added in amxmodmenu also code of menufront also der
Pika Menu
menu Front
Pika Menu
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Pika Menu"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSettings[33]
new g_menuSelect[33][64]
new g_menuSelectNum[33]
new g_coloredMenus
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_pikamenu", "cmdPikaMenu", ADMIN_LEVEL_D, "-Bring Up Pikamenu");
register_menucmd(register_menuid("Pika Menu"), 1023, "actionPikaMenu");
// Add your code here...
}
public actionPikaMenu(id, key)
{
switch (key)
{
case 8: displayPikaMenu(id, ++g_menuPosition[id])
case 9: displayPikaMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
new authid[32], authid2[32], name[32], name2[32]
get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)
get_user_name(player, name2, 31)
new userid2 = get_user_userid(player)
server_cmd("amx_pika #%d", userid2)
server_exec()
menu_destroy(id);
}
}
return PLUGIN_HANDLED
}
displayPikaMenu(id, pos)
{
if (pos < 0)
return
get_players(g_menuPlayers[id], g_menuPlayersNum[id])
new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 8
if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0
new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "PIKA_MENU", pos + 1, (g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0)))
new end = start + 8
new keys = MENU_KEY_0
if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]
for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)
if (access(i, ADMIN_IMMUNITY) && i != id)
{
++b
if (g_coloredMenus)
len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
else
len += format(menuBody[len], 511-len, "#. %s^n", name)
} else {
keys |= (1<<b)
if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
else
len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
}
}
if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
show_menu(id, keys, menuBody, -1, "Pika Menu")
}
public cmdPikaMenu(id, level, cid)
{
if (cmd_access(id, level, cid, 1))
displayPikaMenu(id, g_menuPosition[id] = 0)
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
*/
menu Front
AddMenuLang("PIKA_MENU", "amx_pikamenu", get_clcmd_flags("amx_pikamenu", flags) ? flags : ADMIN_LEVEL_D, "Players Menu" )