Recoded sayhooks, now uses SM's silent/public chat triggers.

Began making set functions for the commands that will use them later.
Removed all sayhook cvars.
This commit is contained in:
Greyscale
2009-06-17 14:32:46 -07:00
parent 95c217aad6
commit 681ad45365
18 changed files with 376 additions and 231 deletions

View File

@ -118,6 +118,7 @@ WeaponsOnCommandsCreate()
{
// Forward event to sub-modules.
RestrictOnCommandsCreate();
ZMarketOnCommandsCreate();
}
/**

View File

@ -25,22 +25,6 @@
* ============================================================================
*/
/* * Copyright (C) 2009 Greyscale, Richard Helgeby
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
/**
* Variable to store buyzone offset value.
*/
@ -67,10 +51,12 @@ new String:g_strZMarketLastWeapon[MAXPLAYERS + 1][WeaponsSlot][WEAPONS_MAX_LENGT
new bool:g_bZMarketAutoRebuy[MAXPLAYERS + 1];
/**
* Initialize market data.
* Create commands specific to ZMarket.
*/
ZMarketInit()
ZMarketOnCommandsCreate()
{
// Register ZMarket command.
RegConsoleCmd(SAYHOOKS_KEYWORD_ZMARKET, ZMarketCommand, "Opens custom buymenu.");
}
/**
@ -684,6 +670,29 @@ ZMarketRebuy(client, bool:rebuy = false)
}
}
/**
* Command callback (zmarket)
* Opens custom buymenu.
*
* @param client The client index.
* @param argc Argument count.
*/
public Action:ZMarketCommand(client, argc)
{
// If client is console, then stop and tell them this feature is for players only.
if (ZRIsConsole(client))
{
TranslationPrintToServer("Must be player");
return Plugin_Handled;
}
// Send ZMarket menu.
ZMarketMenuTypes(client);
// This stops the "Unknown command" message in client's console.
return Plugin_Handled;
}
/**
* Checks if a client is in a buyzone.
*