Version 0.0.1
by Exolent
Introduction:
I've seen many plugins written for VIPs that are redundant at declaring who is VIP but also lack many features.
This plugin was designed to allow server owners to easily declare VIPs in multiple methods (.ini file, admin flag, and SQL support) and allow plugin developers to build VIP features from that base.
It is easily extendable as you can see in some of the attached plugins below.
For all customization, see the vip.cfg file attached.
Installation:1. Install vip_manager.amxx anywhere in your plugins.ini and be sure to place the .amxx file in your plugins directory.
2. Place vip.cfg file in the addons/amxmodx/configs directory
3. Place vip_users.ini file in the addons/amxmodx/configs directory[/list]
Setting up VIPs via the file system is just as simple as admins.
Open up vip_users.ini and follow the steps shown inside the file.
If modifying VIPs and you want current players to take affect to privileges, use the vip_reload command when finished editing.
Setting up VIPs in an SQL environment is not difficult at all.
1. You will need to edit the vip.cfg file to have your SQL configuration properly set up.
2. Run the plugin on the server at least once so that the table is created in your SQL database.
3. You can manually go into the table (not recommended) and add VIPs, or use the vip_addauth/vip_adduser commands to set up the VIPs.
4. Changes to the SQL database should be shown in the server immediately. However, players currently in the server during changes won't be affected until next map or if vip_reload is called.
vip_adduser <name, #userid, authid> <type>
- Adds user to vip_users.ini and SQL database (if applicable)
- Player must be connected to server
- <type> can be 'name', 'steamid', or 'ip'
- Remember to use quotations around both inputs!
- Requires rcon flag 'l'
- Adds an authorization to vip_users.ini and SQL database (if applicable)
- <type> can be 'name', 'steamid', 'ip', or 'tag'
- Remember to use quotations around both inputs!
- Requires rcon flag 'l'
- Reloads the users from the file and checks authorizations for all users
- Requires rcon flag 'l'
AMX Mod X 1.8.1 or higher
Plugin API:Functions:
PHP Code:
/**
* Checks whether a player is VIP or not
*
* @param id - Unique index of player
*
* @return True if VIP, false otherwise
*
* @note This could return false in client_connect(), client_authorized(), client_putinserver(), and client_disconnect().
* Use the vip_authorized(), vip_putinserver() and vip_disconnect() forwards instead.
*/
native is_user_vip(id);
PHP Code:
/**
* Called when a VIP player authorizes
*
* @param id - Unique index of player
*
* @return Return values are ignored
*/
forward vip_authorized(id);
/**
* Called when a VIP player joins the server
*
* @param id - Unique index of player
*
* @return Return values are ignored
*/
forward vip_putinserver(id);
/**
* Called when a VIP player disconnects
*
* @param id - Unique index of player
*
* @return Return values are ignored
*/
forward vip_disconnect(id);
Remember when developing with 3rd-party includes such as vip.inc, you will need to compile your plugins locally.
See here for more information.Changelog:
Original release
Author Notes:See attached plugins such as vip_features.sma and vip_models.sma for examples on using this API.
vip_models.sma is a poor way to set player models and is only there for a simple example.
All suggestions are welcome to improve this plugin, but be aware that no "special" features for VIPs will be in the API other than determining who is a VIP.
Attached Files






Wyświetl pełny artykuł