Русское сообщество по скриптингу

Лимит  [Решено]

Все вопросы по работе и настройке AMXX и его плагинов.

Модератор: liFe iS GoOD

Правила форума
1. Запрещено материться и оскорблять других участников форума.
2. Запрещен флуд, оффтоп, дабл постинг во всех разделах форума, кроме раздела "Болтовня".
3. Запрещено взламывать сайт/форум или наносить любой вред проекту.
4. Запрещено рекламировать другие ресурсы.
5. Запрещено создавать темы без информативного названия. Название темы должно отображать ее смысл.

В данном разделе форума разрешено создавать темы, касающие только вопросов по AMX Mod X и его плагинам.

Лимит

Сообщение Lomt1k » 21 мар 2019, 22:35

Как добавить лимит на открытия меню ножей например 15-20сек?
Заранее спасибо
Аватара пользователя
Lomt1k
 
Сообщения: 6
Зарегистрирован: 14 июл 2018, 16:58
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.
Опыт программирования: Около 3 месяцев
Языки программирования: Я ничего не знаю

Re: Лимит  [Решено]

Сообщение SISA » 22 мар 2019, 00:41

/**
* Displays a menu to the client.
*
* @note Keys is a bitflag value that represents which keys the user can press
* on the menu. If you want to display disabled menu options, or skip
* certain number slots, you should exclude that key from the bitflag.
* amxconst.inc provides MENU_KEY_* constants for convenience.
* @note The title parameter is not displayed to the client and is only used for
* identifying menus internally and assigning them to their callbacks.
* The title corresponds to the menu name that you register with
* register_menuid()
*
* @param index Client to display menu to, use 0 to display to all clients
* @param keys Enabled keys
* @param menu Menu body
* @param time Menu timeout in seconds, -1 to disable
* @param title Name of the menu for internal tracking purposes
*
* @return 1 on success, 0 if menu could not be displayed (client not
* connected)
* @error If a single client is specified and the index is not within
* the range of 1 to MaxClients, an error will be thrown.
*/
native show_menu(index, keys, const menu[], time = -1, const title[] = "");


/**
* Displays a menu to one client. This should never be called from a handler
* when the item is less than 0 (i.e. calling this from a cancelled menu will
* result in an error).
*
* Starting with 1.8.3 this allows to specify a menu timeout similar to the
* show_menu native. If the menu exists on the client past the timeout *any*
* further action will send the MENU_TIMEOUT status code to the menu handler.
* That includes actions which would otherwise send MENU_EXIT, such as the
* client selecting an item or disconnecting and calling menu_cancel or
* menu_destroy on a live menu.
*
* @param id Client index.
* @param menu Menu resource identifier.
* @param page Page to start from (starting from 0).
* @param time If >=0 menu will timeout after this many seconds
* @noreturn
* @error Invalid menu resource or client index.
*/
native menu_display(id, menu, page=0, time=-1);

Правильно работает, на сколько я знаю, на амх 1.8.3 и выше.
Аватара пользователя
SISA
 
Сообщения: 284
Зарегистрирован: 28 ноя 2009, 01:46
Благодарил (а): 19 раз.
Поблагодарили: 126 раз.
Языки программирования: Counter-Strike 1.6
Counter-Strike: Source
Team Fortress II
Left 4 Dead


Вернуться в Вопросы по AMXX и его плагинам

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 5