View Single Post
Author Message
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 12-31-2016 , 09:46   [Any][MySQL] tVip (2.3 | 04-04-21) - The simplest to use Vip Manager
Reply With Quote #1

Hey0,

Today I'm going to present a Plugin to you that is available in other forms but not with this featureset.


This Plugin allows you to add Vips on the fly to your Server, extend their Status or Remove them.
You can also lookup the details of Vips in a simple to use Menu.

The Plugin was designed for Large Communities that run a big amount of servers.
This is why it has a live MySQL Sync. This means no data is stored locally and everything is instantly synced to the database to allow a seamless workflow.


Let's get to the details.

INSTALLATION:
- IT WON'T WORK WITHOUT DOING THIS -
Quote:
The default MySQL config is tVip which needs to be added to your database.cfg.
If you want another name, change line 13 in the .sp
Spoiler


There is a config called tVip under cfg/soucemod that allow you to change the flag.

The following commands are available:

Quote:
sm_tvip - Root Flag - Opens the tVip Admin menu
sm_addvip "<SteamID>" <Duration in Month> "<Name>" [0/default=Month,1=Minutes]- Root Flag - Add a Vip manually (offline)
sm_removevip "<SteamID>" - Root Flag - Removes a Vip manually (offline)
sm_vips - no flag - Shows all VIPs
sm_vip - Displays the Start date, End date and duration of the Status in a menu
Command examples:

PHP Code:
sm_addvip "STEAM_1:0:0000000" 60 "Totenfluch" 
^ Gives the User 60 Minutes of Vip


PHP Code:
sm_addvip "STEAM_1:0:0000000" 60 "Totenfluch" 
^ Gives the User 60 Month of Vip


PHP Code:
sm_addvip "STEAM_1:0:0000000" 1440 "Totenfluch" 
^ Gives the User 1440 Minutes (24h = 1 day) of Vip

Config:
Quote:
// This file was auto-generated by AutoExecConfig read and append beta
// ConVars for plugin "tVip.smx"


// 20=Custom6, 19=Custom5 etc. Numeric Flag See: 'https://wiki.alliedmods.net/Checking_Admin_Flags_(SourceMod_Scripting)' for Definitions ---- Multiple flags seperated with Space: '16 17 18 19' !!
// -
// Default: "19"
tVip_flag "19 20"

// Test Vip duration in minutes
// -
// Default: "15"
tVip_testVipDuration "15"
Compatible Plugins:
[ANY] Reserved Slots with tVip support

That's about it.
I hope it's usefull for some of you.

If you are interested in other Plugins (Zephstore parts & more), checkout my Website

Images:








Natives and forwards:
PHP Code:
/**
 * Grant vip to a client.
 *
 * @param admin          Admin that set VIP.
 * @param client         Client that will recive VIP.
 * @param duration        Vip duration.
 * @param format         Time format, 1 = Minutes - 0 = Month.
 * @noreturn
 * @error                Invalid client/admin Index or invalid format.
 */
native void tVip_GrantVip(int clientint adminint durationint format 1);



/**
 * Delete Vip from database.
 *
 * @param SteamId          Client SteamID.
 * @noreturn
 */
native void tVip_DeleteVip(char SteamId[20]);

/**
 * Forward on Client pre loaded - Vip is about to be loaded
 *
 * @param2 -> int client
 *
 */
forward void tVip_OnClientLoadedPre(int client);


/**
 * Forward on Client post loaded - Vip for client has loaded and is set in flags
 *
 * @param2 -> int client
 *
 */
forward void tVip_OnClientLoadedPost(int client); 
Troubleshooting:

- Invalid Database Handle
fix your database.cfg

- Table does not create but Database Handle is correct
run
Code:
SET SQL_MODE='ALLOW_INVALID_DATES';
in your MySQL Database

Changelog:

Quote:
2.3
* change default date to CURRENT_TIMESTAMP as it is compatible with more databases
2.2
+ add option to add vip using minutes
2.1
+ added natives Thanks @Hexer10
2.0
* Generic Steam ID storage - thanks zeph
* bugfix in extend
* to update you need to drop your tables
1.8
* fixed mysql alter table bug from 1.4/1.5
1.7
* changed some words
1.6
* allows the update of a player on added
1.4/1.5
+ added sm_removevip command
* allowed sm_addvip to be used by the console
1.3
* fixed out of bounds exception in config
1.2
+ Added Multiple Flag Support
+ Added Test Vip
+ Added sm_vip Command
1.1
- Removed Smlib
+ Added Config file for the Flag
1.0 Init
Github: https://github.com/Totenfluch/tVip

Download Count: 2108
Attached Files
File Type: inc tVip.inc (955 Bytes, 1268 views)
File Type: sp Get Plugin or Get Source (tVip.sp - 459 views - 25.6 KB)
File Type: smx tVip.smx (30.4 KB, 380 views)
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...

Last edited by Totenfluch; 04-03-2021 at 18:44.
Totenfluch is offline