it give some errors please fix it with me.
code:
Code: Select all
#include <ze_vip>
#include <ze_unstuck>
native ze_open_knife_menu(id)
// Keys
const OFFSET_CSMENUCODE = 205
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
public plugin_init()
{
register_plugin("[ZE] Main Menu", ZE_VERSION, AUTHORS)
// Commands
register_clcmd("chooseteam", "Cmd_ChooseTeam")
register_clcmd("say /zemenu", "Cmd_ChooseTeam")
register_clcmd("say_team /zemenu", "Cmd_ChooseTeam")
// Register Menus
register_menu("Main Menu", KEYSMENU, "Main_Menu")
}
public Cmd_ChooseTeam(id)
{
if (!is_user_connected(id))
return PLUGIN_CONTINUE;
if (get_member(id, m_iTeam) == TEAM_TERRORIST || get_member(id, m_iTeam) == TEAM_CT)
{
Show_Menu_Main(id)
return PLUGIN_HANDLED // Kill the Choose Team Command
}
// Player in Spec? Allow him to open choose team menu so he can join
return PLUGIN_CONTINUE
}
// Main Menu
public Show_Menu_Main(id)
{
static szMenu[250]
new iLen
// Title
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
// 1. Buy Weapons
if (!ze_is_auto_buy_enabled(id)) // AutoBuy not enabled - normal case
{
if (is_user_alive(id))
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
}
}
else
{
// Auto-Buy enabled - Re-enable case
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY_RE_ENABLE")
}
// 2. Extra Items
if (is_user_alive(id))
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y2. \r%L^n", id, "MENU_EXTRABUY")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
}
// 3. Unstuck
if (is_user_alive(id))
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y3. \r%L^n^n", id, "MENU_UNSTUCK")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d3. %L^n^n", id, "MENU_UNSTUCK")
}
// 4. Sound Menu
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y4. \rSound Menu^n")
// 5. Camer View
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y5. \rCamera View^n")
// 6. Daily Golds
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y6. \rDaily Golds^n^n")
// 7. Random Prizes
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y7. \rRandom Prizes^n")
// 8. Knife Menu
if (ze_get_vip_flags(id) & VIP_A)
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y8. \rKnife Menu \y[\rVIP\y]^n^n")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d8. Knife Menu [\rVIP\d]^n^n")
}
// 9. Admin Menu
if (get_user_flags(id) & ADMIN_KICK)
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y9. \rAdmin Menu^n")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d9. Admin Menu^n")
}
// 0. Exit
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0.\r %L", id, "EXIT")
// Fix for AMXX custom menus
set_pdata_int(id, OFFSET_CSMENUCODE, 0)
show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}
// Main Menu
public Main_Menu(id, key)
{
// Player disconnected?
if (!is_user_connected(id))
return PLUGIN_HANDLED
switch (key)
{
case 0: // Buy Weapons
{
if (!ze_is_auto_buy_enabled(id))
{
ze_show_weapon_menu(id)
}
else
{
ze_disable_auto_buy(id)
Show_Menu_Main(id)
}
}
case 1: // Extra Items
{
if (is_user_alive(id))
{
ze_show_items_menu(id)
}
else
{
ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
}
}
case 2: // Unstuck
{
if (is_user_alive(id))
{
client_cmd(id, "say /unstuck")
}
else
{
ze_colored_print(id, "%L", id, "DEAD_CANT_UNSTUCK")
}
}
case 3: // Sound Menu
{
ze_show_sound_menu(id)
}
case 4: // Camera View
{
client_cmd(id, "say /cam")
}
case 5: // Daily Golds
{
client_cmd(id, "say /get")
}
case 6: // Random Prizes
{
client_cmd(id, "say /prize")
}
case 7: // Knife Menu
{
if (ze_get_vip_flags(id))
ze_open_knife_menu(id)
else
ze_colored_print(id, "!tYou are not !gVIP!y.")
}
case 8: // Admin Menu
{
if (get_user_flags(id) & ADMIN_KICK)
{
client_cmd(id, "amxmodmenu")
}
else
{
ze_colored_print(id, "!tYou are not !gAdmin!y.")
}
}
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/