AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any][SQL]VIP-Manager 2.2.1 (https://forums.alliedmods.net/showthread.php?t=245474)

ShadowManGer 08-02-2014 13:56

[Any][SQL]VIP-Manager 2.2.1
 
4 Attachment(s)
Description

Add VIPs for a specified duration to your server.
VIPs are stored in the "vips" table in your database.

Features
  • Automatic VIP removing
  • Add, substract or set the time for VIPs
  • Easy ingame VIP editing

Installation
Spoiler


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


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.
PHP Code:

forward void OnVIPAdded(int adminchar[] namechar[] steamIdint minutes);
forward void OnVIPDurationChanged(int adminchar[] namechar[] steamIdchar[] modeint oldDurationint duration);
forward void OnVIPRemoved(int adminchar[] namechar[] steamIdchar[] reason); 

Changelog
Spoiler


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

Drixevel 08-02-2014 20:04

Re: [Any][SQL]VIP-Manager
 
Few tips:

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;
}

Same with stuff like line 89 & 90...

Code:

ReplyToCommand(client, "[VIP-Manager] Starting VIP check!");
--

You really don't need to create the function to check if a string is empty, just use the 'StrEqual' function and check if it's empty that way.

Code:

if (StrEqual(query, "")
{
        PrintToServer("Query is empty!");
        continue;
}


ShadowManGer 08-02-2014 20:17

Re: [Any][SQL]VIP-Manager
 
@r3dw3r3w0lf

Thank you!
ReplyToCommand make it easier for me.

kitty0725 09-14-2014 04:57

Re: [Any][SQL]VIP-Manager
 
Can you show me the example of the mysql?

This?
"vip-manager"
{
"driver" "mysql"
"host" "localhost"
"database" "vip-manager"
"user" "username"
"pass" "password"
}

ShadowManGer 09-15-2014 09:12

@kitty0725
 
My plugin currently use the default SQL connection.

So you have to configure the default connection.
Code:

"default"
{
        "driver"                        "mysql"
        "host"                        "localhost"
        "database"                        "vip-manager"
        "user"                        "username"
        "pass"                        "password"
}


DJ Data 09-16-2014 19:55

Re: @kitty0725
 
Quote:

Originally Posted by ShadowManGer (Post 2198956)
My plugin currently use the default SQL connection.

So you have to configure the default connection.
Code:

"default"
{
        "driver"                        "mysql"
        "host"                        "localhost"
        "database"                        "vip-manager"
        "user"                        "username"
        "pass"                        "password"
}


You have to get this fixed ASAP. Make it use its own.

qiuhaian 09-17-2014 21:23

Re: [Any][SQL]VIP-Manager
 
Nice work!
I have a suggestion,Whether you can customize the vip's flag? not only the flag "a".


other,don't Delete the outdate vip,can you change the outdate vip's flag "a" to customize flag,such as "s".

Thanks a million.

sorry for may bad english

ShadowManGer 11-22-2014 18:09

Update news!
 
Hey guys,
sorry for my lack of activity, but i had a lot of things to do.

I just want to tell you that i'm currently working on the new version 1.1 which contains following features:
  • Option to handle VIPs offline
  • Option to change the VIP flag
  • Option to store VIPs in an admin group
  • Moving custom SQL queries into a key value file
  • Possibility to add VIPs with only special characters in its name

If you have some suggestions or have found some bugs, then let me know that :D

TUSK3N1337 11-23-2014 05:58

Re: [Any][SQL]VIP-Manager
 
Is this working with sourcebans?

Trosty 11-23-2014 08:47

Re: [Any][SQL]VIP-Manager
 
You can add an web page to show vip members and how much time they have?


All times are GMT -4. The time now is 04:49.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.