Custom Logos

amxx reapi Custom Logos 1.0

Нет прав для скачивания
Установка
  1. Скомпилируйте плагин (инструкция).
  2. Скопируйте скомпилированный файл .amxx в директорию: amxmodx/plugins/
  3. Пропишите .amxx в файле /amxmodx/configs/plugins.ini
Настройки
Код:
[MENUS]
; <menu title> <menu key> <menu cmds>
"CSGO Box"    "csgobox"    "say /csgobox, csgobox"
"Community Box"    "communitybox"    "say /communitybox, communitybox"

[LOGOS]
; <menu key> <default logo> <logo name> <logo key> <logo model> <logo skin>
"csgobox" "0" "Test logo 1" "testlogo1" "models/spray_csgo.mdl" "1"
"csgobox" "0" "Test logo 2" "testlogo2" "models/spray_csgo.mdl" "2"
"csgobox" "1" "Test logo 3" "testlogo3" "models/spray_csgo.mdl" "3"
"csgobox" "0" "Test logo 4" "testlogo4" "models/spray_csgo.mdl" "4"

Код:
// Reset logos when round start
#define RESET_LOGOS_WHEN_ROUND_START
// Reset logo time when player spawned
#define RESET_LOGO_TIME_PLAYER_SPAWN
//#define DEBUG

new const LOGO_SOUND[] = "player/sprayer.wav";

// in sec
const Float:LOGO_NEXT_TIME = 60.0;
// in units
const Float:LOGO_DISTANCE = 100.0;

// in sec
const Float:LOGO_REMOVE_TIME = 30.0;
// in sec
const Float:LOGO_SMOOTH_TIME = 0.2;
// + render
const Float:LOGO_SMOOTH_RENDER = 50.0;
// Logo size
const Float:LOGO_SIZE = 40.0;
API
Код:
#if defined _custom_logos_included
    #endinput
#endif
#define _custom_logos_included

#include <custom_logos_const>

/**
* Retrieves info (MenuData_s) about a menu by index.
*
* @param index                 Item index in the array
* @param temp_menu             Array data
*
* @return                      Error code
*/
native cl_menu_getinfo(index, temp_menu[MenuData_s]);

/**
* Retrieves info (LogoData_s) about a logo by index.
*
* @param index                 Item index in the array
* @param temp_logo              Array data
*
* @return                      Error code
*/
native cl_logo_getinfo(index, temp_logo[LogoData_s]);

/**
* Get default logo index.
*
* @return                default logo index on success, -1 on error
*/
native cl_get_default_logo();

/**
* Find a logo index by key.
*
* @param logo_key        Logo key
*
* @return                logo index on success, -1 on error
*/
native cl_find_logo_index(logo_key[MAX_LOGO_KEY_LENGTH]);

/**
* Handler for menu.
*
* @param id        Player id
* @param menu      Menu id
* @param item      Item id
*
* @return          PLUGIN_CONTINUE to let a player to use logo
*                  PLUGIN_HANDLED or higher to prevent a player to use logo
*/
forward cl_menu_handler(id, menu, item);

/**
* Callback for menu.
*
* @param id        Player id
* @param menu      Menu id
* @param item      Item id
*
* @return          ITEM_IGNOREAD to let a player to use item
*                  ITEM_DISABLED or higher to prevent use item
*/
forward cl_menu_callback(id, menu, item);

/**
* Called when logo selected.
*
* @param id            Player id
* @param new_logo         Selected logo
* @param old_logo      Current (old) logo
*
* @noreturn
*/
forward cl_logo_selected(id, new_logo, old_logo);

Код:
#if defined _custom_logos_const_included
    #endinput
#endif
#define _custom_logos_const_included

enum
{
    ERR_PLAYER_IS_NOT_IN_GAME = -1,
    ERR_INVALID_INDEX,
    ERR_INVALID_KEY,
    ERR_ARRAY_EMPTY,
    ERR_SUCCESS
};

const MAX_MENU_NAME_LENGTH = 64;
const MAX_MENU_KEY_LENGTH = 16;
const MAX_MENU_CMDS_LENGTH = 128;

const MAX_LOGO_NAME_LENGTH = 32;
const MAX_LOGO_KEY_LENGTH = 16;
const MAX_LOGO_MODEL_LENGTH = 256;

const IMPULSE_LOGO = 201;
const LOGO_NONE = -1;

const Float:LOGO_MAX_RENDERAMT = 255.0;

enum _:MenuData_s
{
    MENU_ID,
    MENU_NAME[MAX_MENU_NAME_LENGTH],
    MENU_KEY[MAX_MENU_KEY_LENGTH],
    MENU_CMDS[MAX_MENU_CMDS_LENGTH]
};

enum _:LogoData_s
{
    LOGO_MENU_KEY[MAX_MENU_KEY_LENGTH],
    bool:LOGO_DEFAULT,
    LOGO_NAME[MAX_LOGO_NAME_LENGTH],
    LOGO_KEY[MAX_LOGO_KEY_LENGTH],
    LOGO_MODEL[MAX_LOGO_MODEL_LENGTH],
    LOGO_SKIN
};

Код:
#if defined _custom_logos_current_logo_included
    #endinput
#endif
#define _custom_logos_current_logo_included

/**
* Set current logo.
*
* @param id                     Player id
* @param index                 Item index in the array
*
* @return                      Error code
*/
native cl_set_current_logo(id, index);

/**
* Get current logo.
*
* @param id                     Player id
*
* @return                      logo index on success, -1 on error
*/
native cl_get_current_logo(id);
Сверху Снизу