|
Junior Member
|

01-10-2016
, 16:16
[Help] Is the script correct?
|
#1
|
Hey,
I recently tried to write a script (for counter strike 1.6), that would allow me to open amxmodmenu. Unfortunately, for some unknown reason my server says that "amxmodmenu" is an unknown command, so I decided to write a menu plugin, an alternative to amxmodmenu, so this is what I came up with:
Quote:
#include amxmodx
#define PLUGIN "amxmodmenu"
#define VERSION "1.0"
#define AUTHOR "JohnnieWalker"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /amenu", "server_menu" )
}
public client_authorized(id)
{
client_cmd(id, "bind ^"l^" ^"say /amenu^"")
}
public server_menu(id)
{
new i_Menu = menu_create("\wAmxModMenu", "MMENU" )
menu_additem(i_Menu, "\wShecvale Mapi", "1", 0)
menu_additem(i_Menu, "\wVoteMapis Dawyeba", "2", 0)
menu_additem(i_Menu, "\wMieci Kicki", "3", 0)
menu_additem(i_Menu, "\wMieci Bani", "4", 0)
menu_additem(i_Menu, "\wSlap/Slay", "5", 0)
menu_additem(i_Menu, "\wSheucvale Gundi", "6", 0)
menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, i_Menu, 0)
return PLUGIN_HANDLED
}
public MMENU(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new s_Data[6], s_Name[64], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)
switch(i_Key)
{
case 1:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_mapmenu" )
}
else
{
server_menu(id)
}
case 2:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_votemapmenu" )
}
else
{
server_menu(id)
}
case 2:
{
client_cmd(id, "amx_votemapmenu" )
}
case 3:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_kickmenu" )
}
else
{
server_menu(id)
}
case 3:
{
client_cmd(id, "amx_kickmenu" )
}
case 4:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_banmenu" )
}
else
{
server_menu(id)
}
case 4:
{
client_cmd(id, "amx_banmenu" )
}
case 5:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_slapmenu" )
}
else
{
server_menu(id)
}
case 6:
if(get_user_flags(id) & ADMIN_MENU)
{
client_cmd(id, "amx_teammenu" )
}
else
{
server_menu(id)
}
case 6:
{
client_cmd(id, "amx_teammenu" )
}
{
client_cmd(id, "" )
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
|
If you can find any problem with the script, and you're kind enough to help me, please leave a message with the corrected script.
Kind regards,
Nick.
Note**
Unfortunately, It wont compile. There's something wrong with the script. Help!
|
|