[MENUS]
; <menu title> <menu key> <menu cmds>
"SUPER ЛОГО" "sprays" "say /spray, say spray, say logo, say /logo"
[LOGOS]
; <menu key> <default logo> <logo name> <logo key> <logo model> <logo skin> <logo size> <logo flags> <logo pos: TOP,BOTTOM,CENTER>
"sprays" "1" "КОРОНА" "testlogo0" "models/patriot_spray1.mdl" "0" "50" "z" "TOP,BOTTOM,CENTER"
"sprays" "0" "КОРОНА" "testlogo1" "models/patriot_spray1.mdl" "0" "50" "z" "TOP,BOTTOM,CENTER"
"sprays" "0" "УМНЫЙ" "testlogo2" "models/patriot_spray1.mdl" "1" "50" "z" "TOP"
"sprays" "0" "МОЛОДЕЦ" "testlogo3" "models/patriot_spray1.mdl" "2" "50" "a" "BOTTOM"
"sprays" "0" "МЕДВЕДЬ" "testlogo4" "models/patriot_spray1.mdl" "3" "50" "z" "CENTER"
"sprays" "0" "КОШАК" "testlogo5" "models/patriot_spray1.mdl" "4" "50" "a" "TOP,BOTTOM,CENTER"
"sprays" "0" "ЛАМПА" "testlogo6" "models/spray_lump2.mdl" "0" "20" "a" "CENTER"
#include <amxmodx>
#include <reapi>
#include <engine>
#include <fakemeta>
#include <xs>
#include <custom_logos>
#include <custom_logos_current_logo>
#define PLUGIN_NAME "Custom Logos EX: Drawing"
#define PLUGIN_VERSION "1.2"
#define PLUGIN_AUTHOR "Denzer, karaulov"
// 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";
new const LOGO_CLASSNAME[] = "custom_logo";
// in sec
const Float:LOGO_NEXT_TIME = 30.0;
// in units
const Float:LOGO_DISTANCE = 120.0;
// in sec
const Float:LOGO_REMOVE_TIME = 60.0;
// in sec
const Float:LOGO_SMOOTH_TIME = 0.1;
// + render
const Float:LOGO_SMOOTH_RENDER = 50.0;
#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 LOGO_ALLOW_TOP = 0x10;
const LOGO_ALLOW_BOTTOM = 0x100;
const LOGO_ALLOW_CENTER = 0x1000;
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,
LOGO_SIZE,
LOGO_FLAGS,
LOGO_POS
};
#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]);
/**
* Find a logo index by key.
*
* @param id Player id
* @param logo_key Logo key
*
* @return logo index on success, -1 on error
*/
native cl_find_logo_index_ex(id, 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_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);