Quote:
Originally Posted by L4D2Noob
Hey guys! I attached a version of the plugin that I edited for my server. Her changes: - Reduced the number of bonuses issued for killing infected
- Defibrillator and full HP cut out for balance
- Fixed a bug with a double purchase of adrenaline
- Prices increased by 2 times
- Fully translated into Russian
But I still did not understand how to limit the use of the !Shop command? So that it can be used every 4 minutes. Help pills :-)
|
HTML Code:
public Action HinT(int client, int args) // создаем функцию для комманды)
{
Menu menu = CreateMenu(MeleeMenuHandler);
SetMenuTitle(menu, "Твои деньги %d", g_iCredits[client]);
AddMenuItem(menu, "option1", "Оружие");
AddMenuItem(menu, "option2", "Рукопашное");
AddMenuItem(menu, "option3", "Остальное");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
SetMenuExitButton(menu, true);
// Timer
int currentTime = GetTime();
if (cooldownTimes[client] != -1 && cooldownTimes[client] > currentTime)
{
ReplyToCommand(client, "Эй, ты слишком часто используешь магазин, подожди ка!");
return Plugin_Handled;
}
// ayy at this point they're thing is -1 (they haven't used it before) or their cooldown is OK
cooldownTimes[client] = currentTime + 240;
//End Timer
return Plugin_Handled;
}
The code that is above, it creates a menu and starts counting the Cooldown at the same time.
How to make it right so that either the menu opens or the Cooldown starts?
__________________