2008-10-04 22:59:11 +02:00
|
|
|
/**
|
|
|
|
* ====================
|
|
|
|
* Zombie:Reloaded
|
|
|
|
* File: sayhooks.inc
|
|
|
|
* Author: Greyscale
|
|
|
|
* ====================
|
|
|
|
*/
|
|
|
|
|
|
|
|
HookChatCmds()
|
|
|
|
{
|
|
|
|
RegConsoleCmd("say", SayCommand);
|
|
|
|
RegConsoleCmd("say_team", SayCommand);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:SayCommand(client, argc)
|
|
|
|
{
|
|
|
|
new bool:enabled = GetConVarBool(gCvars[CVAR_ENABLE]);
|
|
|
|
if (!client || !enabled)
|
|
|
|
{
|
|
|
|
return Plugin_Continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:args[192];
|
|
|
|
|
|
|
|
GetCmdArgString(args, sizeof(args));
|
|
|
|
ReplaceString(args, sizeof(args), "\"", "");
|
|
|
|
|
|
|
|
if (StrEqual(args, "!zmenu", false))
|
|
|
|
{
|
|
|
|
MainMenu(client);
|
|
|
|
}
|
|
|
|
|
2009-03-30 21:40:56 +02:00
|
|
|
if (StrEqual(args, "!zadmin", false))
|
|
|
|
{
|
|
|
|
ZRAdminMenu(client);
|
|
|
|
}
|
|
|
|
|
2009-04-14 23:16:31 +02:00
|
|
|
/*else if (StrEqual(args, "!zclass", false))
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
|
|
|
ZClass(client);
|
2009-04-14 23:16:31 +02:00
|
|
|
}*/
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
else if (StrEqual(args, "!zmarket", false))
|
|
|
|
{
|
|
|
|
ZMarket(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (StrEqual(args, "!zspawn", false))
|
|
|
|
{
|
|
|
|
ZSpawn(client);
|
|
|
|
}
|
|
|
|
|
2008-12-20 20:46:05 +01:00
|
|
|
else if (StrEqual(args, "!tp", false) ||
|
|
|
|
StrEqual(args, "!ztele", false) ||
|
|
|
|
StrEqual(args, "!tele", false) ||
|
|
|
|
StrEqual(args, "!teleport", false))
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-03-30 21:40:56 +02:00
|
|
|
ZTele(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
2009-01-13 23:24:10 +01:00
|
|
|
else if (StrEqual(args, "!teleabort", false))
|
|
|
|
{
|
|
|
|
AbortTeleport(client, false);
|
|
|
|
}
|
|
|
|
|
2008-10-04 22:59:11 +02:00
|
|
|
else if (StrEqual(args, "!zhp", false))
|
|
|
|
{
|
2009-04-16 01:18:08 +02:00
|
|
|
// Toggle ZHP.
|
|
|
|
ZHPToggle(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
2008-12-20 20:46:05 +01:00
|
|
|
else if (StrContains(args, "teleport", false) != -1
|
|
|
|
|| StrContains(args, "stuck", false) != -1
|
|
|
|
|| StrContains(args, "help", false) != -1)
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "!ztele stuck");
|
|
|
|
}
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
return Plugin_Continue;
|
|
|
|
}
|
|
|
|
|
2009-04-14 23:16:31 +02:00
|
|
|
/*bool:ZClass(client)
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
|
|
|
new bool:classes = GetConVarBool(gCvars[CVAR_CLASSES]);
|
|
|
|
if (!classes)
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Feature is disabled");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
new bool:randomclass = GetConVarBool(gCvars[CVAR_CLASSES_RANDOM]);
|
|
|
|
if (randomclass)
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Random class is enabled");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
ClassMenu(client);
|
|
|
|
|
|
|
|
return true;
|
2009-04-14 23:16:31 +02:00
|
|
|
}*/
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
bool:ZMarket(client)
|
|
|
|
{
|
|
|
|
if (!market)
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Feature is disabled");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!IsPlayerAlive(client))
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Must be alive");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
new bool:buyzone = GetConVarBool(gCvars[CVAR_ZMARKET_BUYZONE]);
|
|
|
|
if (!IsClientInBuyZone(client) && buyzone)
|
|
|
|
{
|
|
|
|
ZR_PrintCenterText(client, "Market out of buyzone");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetGlobalTransTarget(client);
|
|
|
|
|
|
|
|
decl String:title[64];
|
|
|
|
decl String:rebuy[64];
|
|
|
|
|
|
|
|
Format(title, sizeof(title), "%t\n ", "Market title");
|
|
|
|
Format(rebuy, sizeof(rebuy), "%t\n ", "Market rebuy");
|
|
|
|
|
|
|
|
Market_Send(client, title, rebuy);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
ZSpawn(client)
|
|
|
|
{
|
|
|
|
new bool:spawn = GetConVarBool(gCvars[CVAR_ZSPAWN]);
|
|
|
|
if (!spawn)
|
|
|
|
{
|
|
|
|
ZR_PrintToChat(client, "Feature is disabled");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
new team = GetClientTeam(client);
|
|
|
|
if (team != CS_TEAM_T && team != CS_TEAM_CT)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-10-29 22:02:46 +01:00
|
|
|
if (IsPlayerAlive(client))
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2008-10-29 22:02:46 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsPlayerInList(client))
|
|
|
|
{
|
2008-10-04 22:59:11 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RespawnPlayer(client);
|
2008-10-29 22:02:46 +01:00
|
|
|
|
2008-10-04 22:59:11 +02:00
|
|
|
AddPlayerToList(client);
|
|
|
|
}
|