2008-10-11 17:17:51 +02:00
|
|
|
/**
|
|
|
|
* ====================
|
|
|
|
* Zombie:Reloaded
|
|
|
|
* File: admin.inc
|
|
|
|
* Author: Richard H
|
|
|
|
* ====================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "include/adminmenu.inc"
|
2009-04-13 06:00:58 +02:00
|
|
|
new curMenuClass[MAXPLAYERS + 1];
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
bool:ZRAdminMenu(client)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-04-16 03:57:46 +02:00
|
|
|
if (!ZRIsClientAdmin(client))
|
2009-03-29 22:04:47 +02:00
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Must be admin");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-04-12 08:04:00 +02:00
|
|
|
new Handle:menu_zadmin = CreateMenu(ZRAdminMenuHandle);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
2009-04-12 08:04:00 +02:00
|
|
|
SetMenuTitle(menu_zadmin, "%t\n ", "!zadmin main title");
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
decl String:knockbackm[64];
|
|
|
|
decl String:knockback[64];
|
|
|
|
decl String:nvgs[64];
|
|
|
|
decl String:infect[64];
|
|
|
|
decl String:zspawn[64];
|
|
|
|
decl String:ztele[64];
|
2009-04-12 08:04:00 +02:00
|
|
|
decl String:weapons[64];
|
2009-03-29 22:04:47 +02:00
|
|
|
decl String:logflags[64];
|
|
|
|
|
|
|
|
Format(knockbackm, sizeof(knockbackm), "%t", "!zadmin main knockbackm");
|
|
|
|
Format(knockback, sizeof(knockback), "%t", "!zadmin main knockback");
|
|
|
|
Format(nvgs, sizeof(nvgs), "%t", "!zadmin main nvgs");
|
|
|
|
Format(infect, sizeof(infect), "%t", "!zadmin main infect");
|
|
|
|
Format(zspawn, sizeof(zspawn), "%t", "!zadmin main spawn");
|
|
|
|
Format(ztele, sizeof(ztele), "%t", "!zadmin main tele");
|
2009-04-12 08:04:00 +02:00
|
|
|
Format(weapons, sizeof(weapons), "%t", "!zadmin main weapons");
|
2009-03-29 22:04:47 +02:00
|
|
|
Format(logflags, sizeof(logflags), "%t", "!zadmin main logflags");
|
|
|
|
|
2009-04-14 22:05:20 +02:00
|
|
|
AddMenuItem(menu_zadmin, "knockbackm", knockbackm, ITEMDRAW_DISABLED);
|
|
|
|
AddMenuItem(menu_zadmin, "knockback", knockback, ITEMDRAW_DISABLED);
|
|
|
|
AddMenuItem(menu_zadmin, "nvgs", nvgs, ITEMDRAW_DISABLED);
|
2009-04-12 08:04:00 +02:00
|
|
|
AddMenuItem(menu_zadmin, "infect", infect);
|
|
|
|
AddMenuItem(menu_zadmin, "zspawn", zspawn);
|
2009-04-14 22:05:20 +02:00
|
|
|
AddMenuItem(menu_zadmin, "ztele", ztele, ITEMDRAW_DISABLED);
|
2009-04-12 08:04:00 +02:00
|
|
|
AddMenuItem(menu_zadmin, "weapons", weapons);
|
|
|
|
AddMenuItem(menu_zadmin, "logflags", logflags);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-04-12 08:04:00 +02:00
|
|
|
SetMenuExitBackButton(menu_zadmin, true);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-04-12 08:04:00 +02:00
|
|
|
DisplayMenu(menu_zadmin, client, MENU_TIME_FOREVER);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
return true;
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRAdminMenuHandle(Handle:menu_admin, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2009-04-14 22:05:20 +02:00
|
|
|
//ZRKnockbackMMenu(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2009-04-14 22:05:20 +02:00
|
|
|
//ZRClassSelectMenu(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
2009-04-14 22:05:20 +02:00
|
|
|
//ZRNVGSMenu(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
ZRInfectMenu(client);
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
{
|
2008-11-12 16:03:40 +01:00
|
|
|
ZRSpawnAll(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 5:
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
ZRZTeleMenu(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 6:
|
2008-12-26 23:03:29 +01:00
|
|
|
{
|
2009-04-12 08:04:00 +02:00
|
|
|
WeaponsMenuMain(client);
|
2008-12-26 23:03:29 +01:00
|
|
|
}
|
|
|
|
case 7:
|
2009-01-31 20:48:56 +01:00
|
|
|
{
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
MainMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (action == MenuAction_End)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_admin);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-14 22:05:20 +02:00
|
|
|
/**
|
|
|
|
* Needs to be recoded to support new modules.
|
|
|
|
*/
|
|
|
|
/*ZRKnockbackMMenu(client)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_knockbackm = CreateMenu(ZRKnockbackMHandle);
|
2009-04-20 02:56:26 +02:00
|
|
|
new Float:curknockback = GetConVarFloat(g_hCvarsList[CVAR_ZOMBIE_KNOCKBACK]);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetGlobalTransTarget(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetMenuTitle(menu_knockbackm, "%t\n ", "!zadmin knockbackm title", curknockback);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
decl String:knockbackmincrease1[64];
|
|
|
|
decl String:knockbackmdecrease1[64];
|
|
|
|
decl String:knockbackmincrease2[64];
|
|
|
|
decl String:knockbackmdecrease2[64];
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
Format(knockbackmincrease1, sizeof(knockbackmincrease1), "%t", "!zadmin knockbackm increase", "0.1");
|
|
|
|
Format(knockbackmdecrease1, sizeof(knockbackmdecrease1), "%t", "!zadmin knockbackm decrease", "0.1");
|
|
|
|
Format(knockbackmincrease2, sizeof(knockbackmincrease2), "%t", "!zadmin knockbackm increase", "0.5");
|
|
|
|
Format(knockbackmdecrease2, sizeof(knockbackmdecrease2), "%t", "!zadmin knockbackm decrease", "0.5");
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
AddMenuItem(menu_knockbackm, "knockbackmincrease1", knockbackmincrease1);
|
|
|
|
AddMenuItem(menu_knockbackm, "knockbackmdecrease1", knockbackmdecrease1);
|
|
|
|
AddMenuItem(menu_knockbackm, "knockbackmincrease2", knockbackmincrease2);
|
|
|
|
AddMenuItem(menu_knockbackm, "knockbackmdecrease2", knockbackmdecrease2);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
SetMenuExitBackButton(menu_knockbackm, true);
|
|
|
|
|
|
|
|
DisplayMenu(menu_knockbackm, client, MENU_TIME_FOREVER);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRKnockbackMHandle(Handle:menu_knockbackm, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
AddToKnockbackMultiplier(0.1);
|
|
|
|
ZRKnockbackMMenu(client);
|
|
|
|
}
|
2009-03-29 22:04:47 +02:00
|
|
|
case 1:
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
AddToKnockbackMultiplier(-0.1);
|
|
|
|
ZRKnockbackMMenu(client);
|
|
|
|
}
|
2009-03-30 22:40:12 +02:00
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
AddToKnockbackMultiplier(0.5);
|
|
|
|
ZRKnockbackMMenu(client);
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
AddToKnockbackMultiplier(-0.5);
|
|
|
|
ZRKnockbackMMenu(client);
|
|
|
|
}
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_knockbackm);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ZRClassSelectMenu(client)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_class = CreateMenu(ZRClassSelectHandle);
|
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetMenuTitle(menu_class, "%t\n ", "!zadmin class title");
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
// x = index of class
|
|
|
|
for (new x = 0; x < classCount; x++)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
AddMenuItem(menu_class, arrayClasses[x][data_name], arrayClasses[x][data_name]);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetMenuExitBackButton(menu_class, true);
|
|
|
|
DisplayMenu(menu_class, client, MENU_TIME_FOREVER);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRClassSelectHandle(Handle:menu_class, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
curMenuClass[client] = slot;
|
2008-10-11 17:17:51 +02:00
|
|
|
ZRClassKnockbackMenu(client, slot);
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_class);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ZRClassKnockbackMenu(client, classindex)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_knockback = CreateMenu(ZRClassKnockbackHandle);
|
|
|
|
|
|
|
|
new Float:curknockback = arrayClasses[classindex][data_knockback];
|
|
|
|
|
2008-10-11 17:17:51 +02:00
|
|
|
new String:classname[64];
|
|
|
|
GetClassName(classindex, classname, sizeof(classname));
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_knockback, "%t\n ", "!zadmin knockback title", classname, curknockback);
|
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
decl String:knockbackincrease1[64];
|
|
|
|
decl String:knockbackdecrease1[64];
|
|
|
|
decl String:knockbackincrease2[64];
|
|
|
|
decl String:knockbackdecrease2[64];
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
Format(knockbackincrease1, sizeof(knockbackincrease1), "%t", "!zadmin knockback increase", "0.1");
|
|
|
|
Format(knockbackdecrease1, sizeof(knockbackdecrease1), "%t", "!zadmin knockback decrease", "0.1");
|
|
|
|
Format(knockbackincrease2, sizeof(knockbackincrease2), "%t", "!zadmin knockback increase", "0.5");
|
|
|
|
Format(knockbackdecrease2, sizeof(knockbackdecrease2), "%t", "!zadmin knockback decrease", "0.5");
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-30 22:40:12 +02:00
|
|
|
AddMenuItem(menu_knockback, "knockbackincrease1", knockbackincrease1);
|
|
|
|
AddMenuItem(menu_knockback, "knockbackdecrease1", knockbackdecrease1);
|
|
|
|
AddMenuItem(menu_knockback, "knockbackincrease2", knockbackincrease2);
|
|
|
|
AddMenuItem(menu_knockback, "knockbackdecrease2", knockbackdecrease2);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetMenuExitBackButton(menu_knockback, true);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
DisplayMenu(menu_knockback, client, MENU_TIME_FOREVER);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRClassKnockbackHandle(Handle:menu_knockback, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
AddToClassKnockback(curMenuClass[client], 0.1);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
AddToClassKnockback(curMenuClass[client], -0.1);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
2009-03-30 22:40:12 +02:00
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
AddToClassKnockback(curMenuClass[client], 0.5);
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
AddToClassKnockback(curMenuClass[client], -0.5);
|
|
|
|
}
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
ZRClassKnockbackMenu(client, curMenuClass[client]);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRClassSelectMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_knockback);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ZRNVGSMenu(client)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_nvgs = CreateMenu(ZRNVGSHandle);
|
2009-04-20 02:56:26 +02:00
|
|
|
new curnvgs = GetConVarInt(g_hCvarsList[CVAR_ZOMBIE_NVGS]);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_nvgs, "%t\n ", "!zadmin nvgs title", curnvgs);
|
|
|
|
|
|
|
|
decl String:nooverride[64];
|
|
|
|
decl String:disable[64];
|
|
|
|
decl String:enable[64];
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
Format(nooverride, sizeof(nooverride), "%t", "!zadmin nvgs no override");
|
|
|
|
Format(disable, sizeof(disable), "%t", "!zadmin nvgs disable");
|
|
|
|
Format(enable, sizeof(enable), "%t", "!zadmin nvgs enable");
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
AddMenuItem(menu_nvgs, "nooverride", nooverride);
|
|
|
|
AddMenuItem(menu_nvgs, "disable", disable);
|
|
|
|
AddMenuItem(menu_nvgs, "enable", enable);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
SetMenuExitBackButton(menu_nvgs, true);
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
DisplayMenu(menu_nvgs, client, MENU_TIME_FOREVER);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRNVGSHandle(Handle:menu_nvgs, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
SetConVarInt(g_hCvarsList[CVAR_ZOMBIE_NVGS], -1);
|
2008-10-11 17:17:51 +02:00
|
|
|
ZRNVGSMenu(client);
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
SetConVarInt(g_hCvarsList[CVAR_ZOMBIE_NVGS], 0);
|
2008-10-11 17:17:51 +02:00
|
|
|
ZRNVGSMenu(client);
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
SetConVarInt(g_hCvarsList[CVAR_ZOMBIE_NVGS], 1);
|
2008-10-11 17:17:51 +02:00
|
|
|
ZRNVGSMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_nvgs);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
2009-04-14 22:05:20 +02:00
|
|
|
}*/
|
2008-10-11 17:17:51 +02:00
|
|
|
|
|
|
|
ZRInfectMenu(client)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_infect = CreateMenu(ZRInfectHandle);
|
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_infect, "%t\n ", "!zadmin infect title");
|
|
|
|
|
|
|
|
AddTargetsToMenu(menu_infect, client, true, true);
|
|
|
|
|
|
|
|
SetMenuExitBackButton(menu_infect, true);
|
|
|
|
|
|
|
|
DisplayMenu(menu_infect, client, MENU_TIME_FOREVER);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRInfectHandle(Handle:menu_infect, MenuAction:action, client, slot)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
decl String:info[32];
|
|
|
|
new userid, target;
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
GetMenuItem(menu_infect, slot, info, sizeof(info));
|
2008-10-11 17:17:51 +02:00
|
|
|
userid = StringToInt(info);
|
|
|
|
|
|
|
|
if ((target = GetClientOfUserId(userid)) == 0)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[ZR] Player no longer available");
|
|
|
|
}
|
|
|
|
else if (!CanUserTarget(client, target))
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[ZR] Unable to target player");
|
|
|
|
}
|
|
|
|
else if (!IsPlayerAlive(target))
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[ZR] Player is dead");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
decl String:name[64];
|
|
|
|
GetClientName(target, name, sizeof(name));
|
2009-04-16 01:18:08 +02:00
|
|
|
InfectPlayer(target);
|
2008-10-11 17:17:51 +02:00
|
|
|
ShowActivity2(client, "[ZR] ", "Infected %s", name);
|
|
|
|
ZRInfectMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_infect);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-12 16:03:40 +01:00
|
|
|
ZRSpawnAll(client)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-04-16 03:57:46 +02:00
|
|
|
// x = client index.
|
|
|
|
for (new x = 1; x < MaxClients; x++)
|
2008-10-11 17:17:51 +02:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
if (IsClientInGame(x))
|
2008-11-15 19:11:36 +01:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
ZSpawn(x);
|
2008-11-15 19:11:36 +01:00
|
|
|
}
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
2008-11-12 16:03:40 +01:00
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
2008-10-11 17:17:51 +02:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
ZRZTeleMenu(client)
|
2008-12-26 23:03:29 +01:00
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_ztele = CreateMenu(ZRTeleHandle);
|
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_ztele, "%t\n ", "!zadmin ztele title");
|
2008-12-26 23:03:29 +01:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
decl String:ztele_spawntele[64];
|
|
|
|
decl String:ztele_abort[64];
|
|
|
|
decl String:ztele_save[64];
|
|
|
|
decl String:ztele_tele[64];
|
2008-12-26 23:03:29 +01:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
Format(ztele_spawntele, sizeof(ztele_spawntele), "%t", "!zadmin ztele spawn tele");
|
|
|
|
Format(ztele_abort, sizeof(ztele_abort), "%t", "!zadmin ztele abort");
|
|
|
|
Format(ztele_save, sizeof(ztele_save), "%t", "!zadmin ztele save");
|
|
|
|
Format(ztele_tele, sizeof(ztele_tele), "%t", "!zadmin ztele tele");
|
2008-12-26 23:03:29 +01:00
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
AddMenuItem(menu_ztele, "ztele_spawntele", ztele_spawntele);
|
|
|
|
AddMenuItem(menu_ztele, "ztele_abort", ztele_abort);
|
|
|
|
AddMenuItem(menu_ztele, "ztele_save", ztele_save);
|
|
|
|
AddMenuItem(menu_ztele, "ztele_tele", ztele_tele);
|
|
|
|
|
|
|
|
SetMenuExitBackButton(menu_ztele, true);
|
|
|
|
DisplayMenu(menu_ztele, client, MENU_TIME_FOREVER);
|
2008-12-26 23:03:29 +01:00
|
|
|
}
|
|
|
|
|
2009-03-29 22:04:47 +02:00
|
|
|
public ZRTeleHandle(Handle:menu_ztele , MenuAction:action, client, slot)
|
2008-12-26 23:03:29 +01:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
// Teleport player.
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
// Abort teleport.
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
// Save location.
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
// Teleport to location.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
CloseHandle(menu_ztele);
|
2008-12-26 23:03:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-31 20:48:56 +01:00
|
|
|
ZRLogFlagsMenu(client)
|
|
|
|
{
|
2009-03-29 22:04:47 +02:00
|
|
|
new Handle:menu_log_flags = CreateMenu(ZRLogFlagsMenuHandle);
|
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
SetMenuTitle(menu_log_flags, "%t\n ", "!zadmin log flags title");
|
|
|
|
|
2009-02-13 22:57:02 +01:00
|
|
|
new client_flags = GetUserFlagBits(client);
|
2009-04-13 22:00:37 +02:00
|
|
|
new item_state = (client_flags & ADMFLAG_ROOT) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
|
2009-02-13 22:57:02 +01:00
|
|
|
|
2009-01-31 20:48:56 +01:00
|
|
|
decl String:z_log_core[64];
|
|
|
|
decl String:z_log_game[64];
|
|
|
|
decl String:z_log_player[64];
|
|
|
|
decl String:z_log_debug[64];
|
|
|
|
decl String:z_log_debug_detail[64];
|
|
|
|
decl String:z_log_debug_max[64];
|
|
|
|
decl String:z_log_admins[64];
|
|
|
|
decl String:z_log_client[64];
|
2009-02-13 22:57:02 +01:00
|
|
|
decl String:z_log_ignore_console[64];
|
|
|
|
decl String:z_log_modules_enabled[64];
|
|
|
|
decl String:z_log_module_zombie[64];
|
2009-04-17 01:09:52 +02:00
|
|
|
decl String:z_log_module_ambientsounds[64];
|
2009-02-13 22:57:02 +01:00
|
|
|
decl String:z_log_module_overlays[64];
|
|
|
|
decl String:z_log_module_saytriggers[64];
|
|
|
|
decl String:z_log_module_teleport[64];
|
|
|
|
decl String:z_log_module_classes[64];
|
2009-04-13 22:00:37 +02:00
|
|
|
decl String:z_log_module_weapons[64];
|
2009-04-15 03:24:02 +02:00
|
|
|
decl String:z_log_module_hitgroups[64];
|
2009-02-13 22:57:02 +01:00
|
|
|
decl String:z_log_module_commands[64];
|
|
|
|
decl String:z_log_module_anticamp[64];
|
2009-04-19 19:54:21 +02:00
|
|
|
decl String:z_log_module_damage[64];
|
2009-02-13 22:57:02 +01:00
|
|
|
decl String:z_log_module_offsets[64];
|
2009-01-31 20:48:56 +01:00
|
|
|
|
|
|
|
Format(z_log_core, sizeof(z_log_core), "Log core events (%d)", LogHasFlag(LOG_CORE_EVENTS));
|
|
|
|
Format(z_log_game, sizeof(z_log_game), "Log game events (%d)", LogHasFlag(LOG_GAME_EVENTS));
|
|
|
|
Format(z_log_player, sizeof(z_log_player), "Log player commands (%d)", LogHasFlag(LOG_PLAYER_COMMANDS));
|
|
|
|
Format(z_log_debug, sizeof(z_log_debug), "Log debug messages (%d)", LogHasFlag(LOG_DEBUG));
|
|
|
|
Format(z_log_debug_detail, sizeof(z_log_debug_detail), "Log detailed debug messages (%d)", LogHasFlag(LOG_DEBUG_DETAIL));
|
|
|
|
Format(z_log_debug_max, sizeof(z_log_debug_max), "Log low level debug messages (%d)", LogHasFlag(LOG_DEBUG_MAX_DETAIL));
|
|
|
|
Format(z_log_admins, sizeof(z_log_admins), "Also log to admin chat (%d)", LogHasFlag(LOG_TO_ADMINS));
|
|
|
|
Format(z_log_client, sizeof(z_log_client), "Also log to client console (%d)", LogHasFlag(LOG_TO_CLIENT));
|
2009-02-15 21:33:06 +01:00
|
|
|
Format(z_log_ignore_console, sizeof(z_log_ignore_console), "Don't log messages from the console (%d)", LogHasFlag(LOG_IGNORE_CONSOLE));
|
2009-02-13 22:57:02 +01:00
|
|
|
Format(z_log_modules_enabled, sizeof(z_log_modules_enabled), "Module based log control (%d)", LogHasFlag(LOG_MODULES_ENABLED));
|
|
|
|
Format(z_log_module_zombie, sizeof(z_log_module_zombie), "Zombie (%d)", LogHasFlag(LOG_MODULE_ZOMBIE));
|
2009-04-17 01:09:52 +02:00
|
|
|
Format(z_log_module_ambientsounds, sizeof(z_log_module_ambientsounds), "Ambient Sounds (%d)", LogHasFlag(LOG_MODULE_AMBIENTSOUNDS));
|
2009-02-13 22:57:02 +01:00
|
|
|
Format(z_log_module_overlays, sizeof(z_log_module_overlays), "Overlays (%d)", LogHasFlag(LOG_MODULE_OVERLAYS));
|
|
|
|
Format(z_log_module_saytriggers, sizeof(z_log_module_saytriggers), "Chat commands (%d)", LogHasFlag(LOG_MODULE_SAYTRIGGERS));
|
|
|
|
Format(z_log_module_teleport, sizeof(z_log_module_teleport), "Teleporter (%d)", LogHasFlag(LOG_MODULE_TELEPORT));
|
|
|
|
Format(z_log_module_classes, sizeof(z_log_module_classes), "Classes (%d)", LogHasFlag(LOG_MODULE_CLASSES));
|
2009-04-13 22:00:37 +02:00
|
|
|
Format(z_log_module_weapons, sizeof(z_log_module_weapons), "Weapons (%d)", LogHasFlag(LOG_MODULE_WEAPONS));
|
2009-04-15 03:24:02 +02:00
|
|
|
Format(z_log_module_hitgroups, sizeof(z_log_module_hitgroups), "Hitgroups (%d)", LogHasFlag(LOG_MODULE_HITGROUPS));
|
2009-02-13 22:57:02 +01:00
|
|
|
Format(z_log_module_commands, sizeof(z_log_module_commands), "Admin commands (%d)", LogHasFlag(LOG_MODULE_COMMANDS));
|
|
|
|
Format(z_log_module_anticamp, sizeof(z_log_module_anticamp), "Anticamp (%d)", LogHasFlag(LOG_MODULE_ANTICAMP));
|
2009-04-19 19:54:21 +02:00
|
|
|
Format(z_log_module_damage, sizeof(z_log_module_damage), "Damage (Suicide Intercept) (%d)", LogHasFlag(LOG_MODULE_DAMAGE));
|
2009-02-13 22:57:02 +01:00
|
|
|
Format(z_log_module_offsets, sizeof(z_log_module_offsets), "Offsets (properties) (%d)", LogHasFlag(LOG_MODULE_OFFSETS));
|
2009-01-31 20:48:56 +01:00
|
|
|
|
2009-04-13 22:00:37 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_core, z_log_core, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_game, z_log_game, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_player, z_log_player, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_debug, z_log_debug, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_debug_detail, z_log_debug_detail, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_debug_max, z_log_debug_max, item_state);
|
2009-03-29 22:04:47 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_admins, z_log_admins);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_client, z_log_client);
|
2009-04-13 22:00:37 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_ignore_console, z_log_ignore_console, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_modules_enabled, z_log_modules_enabled, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_zombie, z_log_module_zombie, item_state);
|
2009-04-17 01:09:52 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_module_ambientsounds, z_log_module_ambientsounds, item_state);
|
2009-04-13 22:00:37 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_module_overlays, z_log_module_overlays, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_saytriggers, z_log_module_saytriggers, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_teleport, z_log_module_teleport, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_classes, z_log_module_classes, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_weapons, z_log_module_weapons, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_commands, z_log_module_commands, item_state);
|
|
|
|
AddMenuItem(menu_log_flags, z_log_module_anticamp, z_log_module_anticamp, item_state);
|
2009-04-19 19:54:21 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_module_damage, z_log_module_damage, item_state);
|
2009-04-13 22:00:37 +02:00
|
|
|
AddMenuItem(menu_log_flags, z_log_module_offsets, z_log_module_offsets, item_state);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
|
|
|
SetMenuExitBackButton(menu_log_flags, true);
|
|
|
|
DisplayMenu(menu_log_flags, client, MENU_TIME_FOREVER);
|
2009-01-31 20:48:56 +01:00
|
|
|
}
|
|
|
|
|
2009-04-15 03:24:02 +02:00
|
|
|
public ZRLogFlagsMenuHandle(Handle:menu_log_flags, MenuAction:action, client, slot)
|
2009-01-31 20:48:56 +01:00
|
|
|
{
|
|
|
|
if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
switch(slot)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_CORE_EVENTS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_GAME_EVENTS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_PLAYER_COMMANDS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_DEBUG);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_DEBUG_DETAIL);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 5:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_DEBUG_MAX_DETAIL);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 6:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_TO_ADMINS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 7:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_TO_CLIENT);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
2009-02-13 22:57:02 +01:00
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_IGNORE_CONSOLE);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 9:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULES_ENABLED);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 10:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_ZOMBIE);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 11:
|
|
|
|
{
|
2009-04-17 01:09:52 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_AMBIENTSOUNDS);
|
2009-02-13 22:57:02 +01:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 12:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_OVERLAYS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 13:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_SAYTRIGGERS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 14:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_TELEPORT);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 15:
|
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_CLASSES);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 16:
|
|
|
|
{
|
2009-04-13 22:00:37 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_WEAPONS);
|
2009-02-13 22:57:02 +01:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 17:
|
|
|
|
{
|
2009-04-15 03:24:02 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_HITGROUPS);
|
2009-02-13 22:57:02 +01:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 18:
|
|
|
|
{
|
2009-04-15 03:24:02 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_COMMANDS);
|
2009-02-13 22:57:02 +01:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 19:
|
|
|
|
{
|
2009-04-15 03:24:02 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_ANTICAMP);
|
2009-02-13 22:57:02 +01:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 20:
|
2009-04-15 03:24:02 +02:00
|
|
|
{
|
2009-04-19 19:54:21 +02:00
|
|
|
ToggleLogFlag(LOG_MODULE_DAMAGE);
|
2009-04-15 03:24:02 +02:00
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
|
|
|
case 21:
|
2009-02-13 22:57:02 +01:00
|
|
|
{
|
|
|
|
ToggleLogFlag(LOG_MODULE_OFFSETS);
|
|
|
|
ZRLogFlagsMenu(client);
|
|
|
|
}
|
2009-01-31 20:48:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_Cancel)
|
|
|
|
{
|
|
|
|
if (slot == MenuCancel_ExitBack)
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2009-04-15 03:24:02 +02:00
|
|
|
CloseHandle(menu_log_flags);
|
2009-01-31 20:48:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-11 17:17:51 +02:00
|
|
|
AddToKnockbackMultiplier(Float:value)
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
new Float:current_val = GetConVarFloat(g_hCvarsList[CVAR_ZOMBIE_KNOCKBACK]);
|
|
|
|
SetConVarFloat(g_hCvarsList[CVAR_ZOMBIE_KNOCKBACK], current_val + value);
|
2008-10-11 17:17:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
AddToClassKnockback(classindex, Float:value)
|
|
|
|
{
|
|
|
|
arrayClasses[classindex][data_knockback] = arrayClasses[classindex][data_knockback] + value;
|
|
|
|
}
|
2009-01-31 20:48:56 +01:00
|
|
|
|
|
|
|
ToggleLogFlag(flag)
|
|
|
|
{
|
|
|
|
new log_flags;
|
2009-04-20 02:56:26 +02:00
|
|
|
log_flags = GetConVarInt(g_hCvarsList[CVAR_LOG]);
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-01-31 20:48:56 +01:00
|
|
|
if (log_flags & flag)
|
|
|
|
{
|
|
|
|
log_flags = log_flags - flag;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_flags = log_flags + flag;
|
|
|
|
}
|
2009-03-29 22:04:47 +02:00
|
|
|
|
2009-04-20 02:56:26 +02:00
|
|
|
SetConVarInt(g_hCvarsList[CVAR_LOG], log_flags);
|
2009-01-31 20:48:56 +01:00
|
|
|
}
|