[ANY] Weddings
Опубликовано: 28.08.2013, 11:38
Увеличение картинки
[ANY] Weddings
Описание: Плагин дает возможность выйти за муж/жениться за/на игроков, с которыми вы играете и поддерживать с ними стабильные отношения :xD: 
Установка: Распакуйте архив в папку sourcemod. По дефолту юзается локальная база sourcemod. Чтобы использовать другую впишите "weddings" в sourcemod\configs\databases.cfg и установите sm_weddings_database 1
Команды:

  • sm_marry

Открывает меню для выбора пары

  • sm_revoke

Отмените предложение, которое внесли.

  • sm_proposals

Открывает меню, таким образом, вы можете просмотреть всех игроков, которые сделали предложение вам, выберите предложение и вы будете женаты.
  • sm_divorce

Подайте на развод. Но зачем вы это сделали?

  • sm_couples

Меню с топ-парой, котороая провела больше всех времени вместе. Показывает их имена и дату свадьбы.
  • sm_weddings_reset

Команда администратора, флаг: ban. Обнулить базы данных плагина.

Квары:
PHP код:
// Сколько минут игроки должны ждать после успешного использования команд. 
// - 
// Default: "0" 
// Minimum: "0.000000" 
// Maximum: "30.000000" 
sm_weddings_command_delay "0" 

// Какую базу данных использовать.  
// 0 = sourcemod-local | 1 = другую  
// Если выбрали 1, то впишите "weddings" в "sourcemod\configs\databases.cfg". 
// - 
// Default: "0" 
// Minimum: "0.000000" 
// Maximum: "1.000000" 
sm_weddings_database "0" 

// Следует ли запретить незамужним игрокам присоединяться к серверу. 
// - 
// Default: "0" 
// Minimum: "0.000000" 
// Maximum: "1.000000" 
sm_weddings_disallow_unmarried "0" 

// Сообщение для кикнутых игроков 
// Применяется, только если sm_weddings_disallow_unmarried имеет значение 1. 
// - 
// Default: "Unmarried clients currently not allowed" 
sm_weddings_kick_message "Unmarried clients currently not allowed" 

// Сколько пар показывать в !couples меню.  
// -  
// Default: "10"  
// Minimum: "3.000000"  
// Maximum: "100.000000"  
sm_weddings_show_couples "10"


Natives(Нативы для скриптеров)
PHP код:
/** 
 * Retrieves the slot number of a client's partner. Use this function to check whether a client is married. 
 * 
 * @param client            The slot number of the client. 
 * @return                    The slot number of the partner, -2 if the client is not married, -1 if the partner is not connected. 
 *                            If 0 is returned, then either the client is not connected, or the marital status is still being checked. 
 */ 
native GetPartnerSlot(client); 


/** 
 * Retrieves the name of a client's partner. 
 * 
 * @param client            The slot number of the client. 
 * @param buffer            Destination buffer, will be empty if the client is not married. 
 * @param maxLen            Destination buffer length. 
 * @noreturn 
 */ 
native GetPartnerName(client, String:buffer[], maxLen); 


/** 
 * Retrieves the steam ID of a client's partner. 
 * 
 * @param client            The slot number of the client. 
 * @param buffer            Destination buffer, will be empty if the client is not married. 
 * @param maxLen            Destination buffer length. 
 * @noreturn 
 */ 
native GetPartnerID(client, String:buffer[], maxLen); 


/** 
 * Retrieves the marriage score of a client. 
 * 
 * @param client            The slot number of the client. 
 * @return                    The marriage score, -1 if the client is not married. 
 */ 
native GetMarriageScore(client); 


/** 
 * Retrieves the timestamp of a client's wedding. 
 * 
 * @param client            The slot number of the client. 
 * @return                    The timestamp of the wedding, -1 if the client is not married. 
 */ 
native GetWeddingTime(client); 


/** 
 * Fills an array with the proposals of all connected clients. 
 * Given a client with slot number x, array[x] = -2 means the client has not proposed to anyone, 
 * array[x] = -1 means the client has proposed but the target is not connected. 
 * array[x] = 0 means that either the client is not connected, or the marital status is still being checked. 
 * Any other number indicates the slot number of the target. 
 * This array will NOT be updated! To update the array call GetProposals again. 
 * 
 * @param array                Destination array. 
 * @param maxLen            Destination array length. This should be MaxClients + 1. 
 * @noreturn 
 */ 
native GetProposals(array[], maxLen); 


/** 
 * Fills an array with the marital statuses of all connected clients. 
 * Given a client with slot number x: array[x] = -2 means the client is not married, 
 * array[x] = -1 means the client is married but the partner is not connected. 
 * array[x] = 0 means that either the client is not connected, or the marital status is still being checked. 
 * Any other number indicates the slot number of the partner. 
 * This array will NOT be updated! To update the array call GetMarriages again. 
 * 
 * @param array                Destination array. 
 * @param maxLen            Destination array length. This should be MaxClients + 1. 
 * @noreturn 
 */ 
native GetMarriages(array[], maxLen); 


/** 
 * Called when a client makes a marriage proposal. 
 * 
 * @param proposer            The slot number of the proposer.  
 * @param target            The slot number of the target. 
 * @noreturn                       
 */ 
forward OnProposal(proposer, target); 


/** 
 * Called when a client accepts a marriage proposal. 
 * 
 * @param proposer            The slot number of the proposer.  
 * @param accepter            The slot number of the accepter. 
 * @noreturn                       
 */ 
forward OnWedding(proposer, accepter); 


/** 
 * Called when a client divorces. 
 * 
 * @param divorcer            The slot number of the divorcer. 
 * @param partner            The slot number of the partner, -1 if the partner is not connected. 
 * @noreturn                       
 */ 
forward OnDivorce(divorcer, partner);

История изменений
PHP код:
1.0 
- Initial release. 

1.1  
- Bots no longer listed in the !marry menu. 
- 
Added sm_weddings_version cvar. 

1.2 
- Fixed a rare but possible bug. 
- 
Minor code changes. 

1.3 
- Added a bunch of natives. 
- 
Added sm_weddings_show_couples cvar. 
- 
Added auto-generated weddings.cfg file. 

1.4 
- Added support for a custom database. 
- 
Code changes. 

1.5 
- Connecting players no longer listed in the !marry menu. 
- 
Modified divorce notification: duration of marriage included. 
- 
More natives. 

1.6 
- Added sm_weddings_reset admin command. 

1.7 
- Added sm_weddings_command_delay cvar. 
- 
Fixed a bug. 

1.8 
- Blocking bi-directional proposals, notifying about an existing proposal instead. 
- 
Bug fixes. 

1.9 
- Added sm_weddings_disallow_unmarried, sm_weddings_kick_message cvars. 
- 
Advanced command usage storing, allowing greater delays. 
- 
Added combined marriage score: sum of frags of both clients. 
- 
Top couples ordered by marriage score. 
- 
Bug fixes. 

1.9b 
- Small bug fixes. 

2.0 
- Switched to threaded-sql for better performance. 
- 
Drastically reduced interaction with the database by optimizing code. 
- 
Reworked existing native functions. 
- 
Added new native functions. 

2.0b 
- A few necessary fixes. 

2.0.1 
- Even more fixes. 

2.0.2 
- Filled some documentation gaps. 

2.0.3 
- Small bug fixes. 

2.0.4 
- Swapped marriage date and score in the !couples menu so that points are more easily visible.
















Оригинал
Категория: Плагины sourcemod | Добавил: root Просмотров: 3260 | Загрузок: 118 | Рейтинг: 5.0/13
Скачивать и комментировать могут только зарегистрированные пользователи.

Регистрация или Вход

  1. Комментарии ВКонтакте
  2. Комментарии на сайте
Всего комментариев: 0