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)
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
new bool:enabled = GetConVarBool(g_hCvarsList[CVAR_ENABLE]);
|
2008-10-04 22:59:11 +02:00
|
|
|
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-16 08:08:58 +02:00
|
|
|
else if (StrEqual(args, "!zclass", false))
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-04-16 08:08:58 +02:00
|
|
|
ClassMenuMain(client);
|
|
|
|
}
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
else if (StrEqual(args, "!zmarket", false))
|
|
|
|
{
|
2009-04-16 05:30:26 +02:00
|
|
|
// Send market menu.
|
|
|
|
ZMarketSend(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
ZSpawn(client)
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
new bool:spawn = GetConVarBool(g_hCvarsList[CVAR_ZSPAWN]);
|
2008-10-04 22:59:11 +02:00
|
|
|
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;
|
|
|
|
}
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-04-16 05:30:26 +02:00
|
|
|
RespawnSpawnClient(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|