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))
|
|
|
|
{
|
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)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2009-04-16 05:30:26 +02:00
|
|
|
RespawnSpawnClient(client);
|
2008-10-29 22:02:46 +01:00
|
|
|
|
2008-10-04 22:59:11 +02:00
|
|
|
AddPlayerToList(client);
|
|
|
|
}
|