2008-10-04 22:59:11 +02:00
|
|
|
/**
|
|
|
|
* ====================
|
|
|
|
* Zombie:Reloaded
|
|
|
|
* File: menu.sp
|
|
|
|
* Author: Greyscale
|
|
|
|
* ====================
|
|
|
|
*/
|
|
|
|
|
|
|
|
MainMenu(client)
|
|
|
|
{
|
|
|
|
new Handle:menu_main = CreateMenu(MainMenuHandle);
|
2009-04-16 03:57:46 +02:00
|
|
|
new itemdraw = (ZRIsClientAdmin(client)) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_main, "%t\n ", "!zmenu title");
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
decl String:zadmin[128];
|
2008-10-04 22:59:11 +02:00
|
|
|
decl String:zclass[128];
|
|
|
|
decl String:zmarket[128];
|
|
|
|
decl String:zspawn[128];
|
|
|
|
decl String:ztele[128];
|
|
|
|
decl String:zhp[128];
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
Format(zadmin, sizeof(zadmin), "%t", "!zmenu admin");
|
2009-04-14 23:16:31 +02:00
|
|
|
Format(zclass, sizeof(zclass), "%t", "!zmenu class", ITEMDRAW_DISABLED);
|
2008-10-04 22:59:11 +02:00
|
|
|
Format(zmarket, sizeof(zmarket), "%t", "!zmenu market");
|
|
|
|
Format(zspawn, sizeof(zspawn), "%t", "!zmenu spawn");
|
|
|
|
Format(ztele, sizeof(ztele), "%t", "!zmenu tele");
|
|
|
|
Format(zhp, sizeof(zhp), "%t (%d HP)", "!zmenu hp", GetClientHealth(client));
|
|
|
|
|
2009-04-15 23:40:45 +02:00
|
|
|
AddMenuItem(menu_main, "zadmin", zadmin, itemdraw);
|
2008-10-04 22:59:11 +02:00
|
|
|
AddMenuItem(menu_main, "zclass", zclass);
|
|
|
|
|
2009-04-17 12:16:44 +02:00
|
|
|
if (g_bMarket)
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
|
|
|
AddMenuItem(menu_main, "zmarket", zmarket);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AddMenuItem(menu_main, "zmarket", zmarket, ITEMDRAW_DISABLED);
|
|
|
|
}
|
|
|
|
|
|
|
|
AddMenuItem(menu_main, "zspawn", zspawn);
|
|
|
|
AddMenuItem(menu_main, "ztele", ztele);
|
|
|
|
AddMenuItem(menu_main, "zhp", zhp);
|
|
|
|
|
|
|
|
DisplayMenu(menu_main, client, MENU_TIME_FOREVER);
|
|
|
|
}
|
|
|
|
|
|
|
|
public MainMenuHandle(Handle:menu_main, MenuAction:action, client, slot)
|
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
2009-04-15 23:40:45 +02:00
|
|
|
case 0:
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
if (!ZRAdminMenu(client))
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
|
|
|
MainMenu(client);
|
|
|
|
}
|
|
|
|
}
|
2009-04-15 23:40:45 +02:00
|
|
|
case 1:
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-04-15 23:40:45 +02:00
|
|
|
ClassMenuMain(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
2009-04-15 23:40:45 +02:00
|
|
|
case 2:
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-04-16 05:30:26 +02:00
|
|
|
if (!ZMarketSend(client))
|
2009-03-29 22:04:47 +02:00
|
|
|
{
|
|
|
|
MainMenu(client);
|
|
|
|
}
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
2009-04-15 23:40:45 +02:00
|
|
|
case 3:
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
ZSpawn(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
2009-04-15 23:40:45 +02:00
|
|
|
case 4:
|
2009-03-29 22:04:47 +02:00
|
|
|
{
|
|
|
|
if (!ZTele(client))
|
|
|
|
{
|
|
|
|
MainMenu(client);
|
|
|
|
}
|
|
|
|
}
|
2009-04-15 23:40:45 +02:00
|
|
|
case 5:
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-04-16 01:18:08 +02:00
|
|
|
// Toggle ZHP.
|
|
|
|
ZHPToggle(client);
|
|
|
|
|
|
|
|
// Resend menu.
|
2008-10-04 22:59:11 +02:00
|
|
|
MainMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
|
|
|
CloseHandle(menu_main);
|
|
|
|
}
|
2009-04-19 19:54:21 +02:00
|
|
|
}
|