Coords Manager

amxx Coords Manager 1.0

Нет прав для скачивания
Установка
  1. Скомпилируйте плагин (инструкция).
  2. Скопируйте скомпилированный файл .amxx в директорию: amxmodx/plugins/
  3. Пропишите .amxx в файле /amxmodx/configs/plugins.ini
Настройки
Код:
// File folder
new const COORDS_MANAGER_FILE_FOLDER[] = "coords_manager";
API
Код:
#if defined _coords_manager_included
    #endinput
#endif
#define _coords_manager_included

#include <coords_manager_const>

/**
* Add key.
*
* @param key            Key
*
* @return                 Error code (coords_manager_const)
*/
native cm_add_key(const key[MAX_KEY_LENGTH]);

/**
* Add coord by key.
*
* @param key            Key
* @param origin        Origin array
*
* @return                 Origin index on success, otherwise error code (coords_manager_const)
*/
native cm_add_coord(const key[MAX_KEY_LENGTH], Float:origin[3]);

/**
* Get coord by key.
*
* @param key            Key
* @param index            Origin index
* @param origin        Origin array
*
* @return                 Error code (coords_manager_const)
*/
native cm_get_coord(const key[MAX_KEY_LENGTH], index = NONE_INDEX, Float:origin[3]);

/**
* Get random coord.
*
* @param key            Key
* @param origin        Origin array
*
* @return                 Origin index on success, otherwise error code (coords_manager_const)
*/
native cm_get_random_coord(const key[MAX_KEY_LENGTH] = "", Float:origin[3]);

/**
* Check if key is exists.
*
* @param key            Key
*
* @return                true/false
*/
native bool:cm_key_exists(const key[MAX_KEY_LENGTH]);

/**
* Remove key.
*
* @param key            Key
*
* @return                 Error code (coords_manager_const)
*/
native cm_remove_key(const key[MAX_KEY_LENGTH]);

/**
* Remove coord by index.
*
* @param key            Key
* @param index            Coord info
* @param origin        Origin array
*
* @return                 Error code (coords_manager_const)
*/
native cm_remove_coord(const key[MAX_KEY_LENGTH], index);

/**
* Called when a data loaded.
*
* @noreturn
*/
forward cm_data_loaded();

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

#if !defined MAX_MAPNAME_LENGTH
    #define MAX_MAPNAME_LENGTH 64
#endif

enum
{
    ERR_INVALID_KEY = 0,
    ERR_KEY_NOT_FOUND,
    ERR_INVALID_INDEX,
    ERR_KEY_EXISTS,
    ERR_ARRAY_EMPTY,
    ERR_SUCCESS
};

const MAX_KEY_LENGTH = 32;
const FIRST_INDEX = 0;
const NONE_INDEX = -1;
Сверху Снизу