4. Load VIP-Manager. If there are no errors, VIP-Manager will create the "vips" table in your database automatically.
5. Add, remove or edit VIPs.
ConVars sm_vipm_authid_format Sets which SteamId format should be used. | Engine (default), Steam2, Steam3, Steam64
Commands
For all commands you need the admin root flag! sm_vipm | Lists all commands. sm_vipm_add <"name"> <minutes> | Add a VIP. sm_vipm_rm <"name"> | Remove a VIP. sm_vipm_time <set|add|sub> <"name"> <minutes> | Change the duration for a VIP. sm_vipm_check | Checks for expired VIPs.
Adding VIPs
Spoiler
Adding a connected player
If the player you want to add as a VIP is connected to the server, you can give a part of the name (or the full name) and the duration as parameter.
VIP-Manager will automatically read the SteamId and the full name of the player and add them as a VIP.
Code:
sm_vipm_add player 10
Adding a disconnected player
If the player isn't connected, you can give the name, the duration and the SteamId as parameter.
VIP-Manager will use the given name and SteamId for the VIP.
Code:
sm_vipm_add player_red 10 "[U:1:123]"
If you want that a player has umlimited VIP, just use a duration of -1.
Code:
sm_vipm_add player_blue -1 "[U:1:124]"
Forwards
You want to create your own plugin which needs to react to changes of VIPs?
No problem! Just include the "VIP-Manager.inc" file into your plugin and use these forwards.
2.2.1All changes
- On rebuild admin cache VIPs will be checked for expiration before adding them to the admin cache.
- Closed memory leaks.
- Corrected the checking for expiration of a VIP.
- Fixed "OnClientPostAdminCheck" won't be called.
2.2All changes
- Added SQLite support.
- Added ConVar "sm_vipm_authid_format" to change the SteamId format.
- Admins can no longer lose their permission.
- Better handling of VIP creating, removing, fetching and manipulating.
- Cleaned up the code.
2.1All changes
- Added command for checking all VIPs for expiration.
- Added command to list all commands.
- Added optional SteamId parameter for "sm_vipm_add". If the SteamId is given VIP-Manager will use the given name and SteamId for the VIP.
- Fixed VIPs with a duration of 0 won't be deleted.
- Fixed a potential buffer overflow for some queries.
- Fixed the description of forward "OnVIPDurationChanged".
2.0All changes
- Re-wrote of the plugin. Using sourcepawn 1.7 syntax.
- Using threaded sql connection.
- Using own sql table for storage instead of sourcemod's admin table.
- Changed time unit from days to minutes.
- Checking VIP for time expiration when player connected.
- Added forwards for usage in other plugins.
- Add and remove VIPs in admin cache, while the player is connected. So players don't need to reconnect.
- Removed custom sql queries.
- Removed logging.
1.0
- First release
Source Code
The source code is available under GitLab.
Feel free to fork and edit for your purpose!
Feedback
Please give me your feedback. I'm open for new ideas.
You can create a new issue on GitLab
Last edited by ShadowManGer; 07-02-2017 at 07:45.
Reason: Release 2.2.1
Instead of using a method that checks if the client using the 'VIP_Help' is a client over 0 to check if it's console, just use the 'ReplyToCommand' function.
Example:
Code:
public Action:VIP_Help(client, args)
{
ReplyToCommand(client, "vipm_help | Show this text.");
ReplyToCommand(client, "vipm_add <name> <days> [\"SteamID\"] | Adds a new VIP for give days.");
ReplyToCommand(client, "vipm_rm <name> | Remove a VIP.");
ReplyToCommand(client, "vipm_time <set|add|sub> <\"name\"> <time> | Change time of a VIP.");
ReplyToCommand(client, "vipm_check | Checks for outdated VIPs.");
ReplyToCommand(client, "[VIP-Manager] by %s (Version %s)", Author, Version);
return Plugin_Handled;
}