Raised This Month: $186 Target: $400
 46% 

[CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks


Post New Thread Reply   
 
Thread Tools Display Modes
Author
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Plugin ID:
6111
Plugin Version:
3.7
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Advanced vip system for counter strike
    Old 04-27-2018 , 15:25   [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #1

    [CSGO/CSS?]Upgraded & Fixed VIP System(Version 3.7)
    This vip system is a remake of my old vip system

    This system allow you:
    • Add&Remove Online/Offline VIPs
    • Add/Remove VIPs For Time
    • VIP Features
    • No need in flags!
    VIP Features:
    • Custom chat&clan tag
    • Tag color
    • Name color
    • Chat color
    • Start with Full Armor
    • Start with Defuse Kit
    • Start with 10 HP bonus
    • VIP Skins
    • Connect&Disconnect messages on screen
    • Reserved Slots(When connecting via console)
    • All the features are located in the vip menu and can be used also in a command.
    Commands:
    • sm_addvip - Adds A VIP(example: sm_addvip s4muray 1) - Root Only!
    • sm_removevip - removes a VIP(example: sm_removevip s4muray) - Root only!
    • sm_vip - Opens the VIP menu - Only VIPs can access it!
    • sm_skins - Opens the skins menu - Only VIPs
    • sm_tag - Change your tag - only VIPs!
    • sm_clantag - Change your clantag - only VIPs!
    • sm_tagcolor - Opens a menu with colors, the selected color will be the tag color - VIPs Only!
    • sm_namecolor - Same as tag color but the selected color will be the name color - VIPs Only!
    • sm_chatcolor - Same as tag and chat colors but the selected color will be the chat text color - VIPs Only!
    Cvars:
    • sm_vipsystem_enable - Enable or disable the VIP system? (default: 1)
    • sm_vipsystem_skins - Enable or disable the "Player Skins" option? (default: 1)
    • sm_vipsystem_defuse - Enable or disable the "Defuse Kit Bonus" option? (default: 1)
    • sm_vipsystem_health - Enable or disable the "10 HP Bonus" option? (default: 1)
    • sm_vipsystem_armor - Enable or disable the "Full Armor" option? (default 1)
    • sm_vipsystem_health_amount - How much hp bonus will VIP players can get if hp bonus is enabled? (Default 10)
    Installation:
    • Download the SMX file to your computer
    • Download the Simple Chat Processor if you dont have it
    • Upload the SMX file to "addons/sourcemod/plugins"
    • Configure and upload the txt files(skins.txt, blockedtags.txt) to "addons/sourcemod/configs"
    • Create a database entry named "vipsystem" in the database.cfg(Example here)
    • Change map or restart your server
    • Enjoy the VIP System!
    To compile:
    • Download the SP file
    • Download the scp.inc file
    • Download the csgovip.inc file
    • Upload the scp.inc file to your compiler
    • Edit what you want to
    • Compile
    Changelog:
    Spoiler

    If you are having bugs with the chat stuff try this fix: Click Here
    If you Appreciate my work you can donate me in Paypal or in Trade Offer
    Attached Files
    File Type: zip csgovip-3.7.zip (38.8 KB, 132 views)
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP

    Last edited by BraveFox; Yesterday at 10:30.
    BraveFox is offline
    OfficialSikari
    Junior Member
    Join Date: Aug 2017
    Location: /dev/null
    Old 04-27-2018 , 16:08   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #2

    First of all, Im not here to tell you what to do, but to point some things out.

    Code:
    if (StrEqual(gB_SteamID, "BOT"))
        return;
    You have this piece of code showing up a few times, you should use IsFakeClient() instead.
    This would also be a minor optimization if you do it before GetClientAuthId()


    I also noticed that you seem to give your local variables the g prefix while your global variables dont have that, in my opinion those should be quite the other way around.

    You also seem to prefix your char arrays b which would indicate that its a boolean.
    You should use either sz or c for char arrays, or something else that would better indicate that its a char array.

    You seem to give your strings "hardcoded" maxlength instead of using sizeof(). Heres an example of line 973.

    You should use sizeof(sTest) instead of giving 512 as the maxlength.

    Code:
    public Action Timer_ApplySkin(Handle timer, any client)
    {
        char sTest[512];
        Format(sTest, 512, "%s", clientskin[client]) // Should fix crashes
        PrecacheModel(sTest);
        SetEntityModel(client, sTest);
    }
    And again, im not complaining. Im pointing out things.

    Last edited by OfficialSikari; 04-27-2018 at 16:09.
    OfficialSikari is offline
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-27-2018 , 16:34   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #3

    Quote:
    Originally Posted by OfficialSikari View Post
    First of all, Im not here to tell you what to do, but to point some things out.

    Code:
    if (StrEqual(gB_SteamID, "BOT"))
        return;
    You have this piece of code showing up a few times, you should use IsFakeClient() instead.
    This would also be a minor optimization if you do it before GetClientAuthId()


    I also noticed that you seem to give your local variables the g prefix while your global variables dont have that, in my opinion those should be quite the other way around.

    You also seem to prefix your char arrays b which would indicate that its a boolean.
    You should use either sz or c for char arrays, or something else that would better indicate that its a char array.

    You seem to give your strings "hardcoded" maxlength instead of using sizeof(). Heres an example of line 973.

    You should use sizeof(sTest) instead of giving 512 as the maxlength.

    Code:
    public Action Timer_ApplySkin(Handle timer, any client)
    {
        char sTest[512];
        Format(sTest, 512, "%s", clientskin[client]) // Should fix crashes
        PrecacheModel(sTest);
        SetEntityModel(client, sTest);
    }
    And again, im not complaining. Im pointing out things.
    Thanks for the tips, I'm uploading a new version which have a changed syntax and fixed a bug with the vip time left & the expire.
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP
    BraveFox is offline
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-27-2018 , 16:44   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #4

    Updated again the sourcecode.
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP
    BraveFox is offline
    arne1288
    SourceMod Moderator
    Join Date: Apr 2012
    Old 04-27-2018 , 16:58   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #5

    public Action Command_AddVIP(int client, int args):

    Code:
    [...]
    				//Info
    				char playername[MAX_NAME_LENGTH], steamid[32];
    				GetClientName(target_list[i], playername, MAX_NAME_LENGTH);
    				GetClientAuthId(target_list[i], AuthId_Steam2, steamid, 32);
    				
    				int iLength = ((strlen(playername) * 2) + 1);
    [...]
    public Action Command_RemoveVIP(int client, int args):

    Code:
    [...]
    			for (int i = 0; i < target_count; i++)
    			{
    				char steamid[64];
    				GetClientAuthId(target_list[i], AuthId_Steam2, steamid, sizeof(steamid));
    				SQL_RemoveVIP(steamid);
    				g_iClientTime[target_list[i]] = 0;
    				b_bIsClientVIP[target_list[i]] = false;
    				PrintToChat(client, "%s%N has been removed from a VIP", prefix, target_list[i]);
    			}
    [...]
    void UpdatePlayer(int client):

    Code:
    [...]
    	char gB_Query[512], steamid[32];
    	GetClientAuthId(client, AuthId_Steam2, steamid, 32);
    [...]
    public void SQL_InsertPlayer_Callback(Database db, DBResultSet results, const char[] error, any data):

    Code:
    [...]
    	if (SQL_GetRowCount(results) == 0)
    	{
    		char steamid[64];
    		GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
    		SQL_RemoveVIP(steamid);
    	}
    [...]
    stock void CheckTimeLeft(int client):

    Code:
    [...]
    	char authid[64];
    	GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
    [...]


    GetClientAuthId gives a boolean value, check it before you use it? :'(

    Just like you did in:

    public void SQL_SelectPlayer_Callback(Database db, DBResultSet results, const char[] error, any data):

    Code:
    [...]
    	char steamid[32];
    	if (!GetClientAuthId(client, AuthId_Steam2, steamid, 32))
    	{
    		return;
    	}
    [...]
    __________________
    Mostly known as "DarkDeviL".

    Dropbox FastDL: Public folder will no longer work after March 15, 2017!
    For more info, see the [SRCDS Thread], or the [HLDS Thread]
    arne1288 is offline
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-27-2018 , 17:41   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #6

    Quote:
    Originally Posted by arne1288 View Post
    public Action Command_AddVIP(int client, int args):

    Code:
    [...]
    				//Info
    				char playername[MAX_NAME_LENGTH], steamid[32];
    				GetClientName(target_list[i], playername, MAX_NAME_LENGTH);
    				GetClientAuthId(target_list[i], AuthId_Steam2, steamid, 32);
    				
    				int iLength = ((strlen(playername) * 2) + 1);
    [...]
    public Action Command_RemoveVIP(int client, int args):

    Code:
    [...]
    			for (int i = 0; i < target_count; i++)
    			{
    				char steamid[64];
    				GetClientAuthId(target_list[i], AuthId_Steam2, steamid, sizeof(steamid));
    				SQL_RemoveVIP(steamid);
    				g_iClientTime[target_list[i]] = 0;
    				b_bIsClientVIP[target_list[i]] = false;
    				PrintToChat(client, "%s%N has been removed from a VIP", prefix, target_list[i]);
    			}
    [...]
    void UpdatePlayer(int client):

    Code:
    [...]
    	char gB_Query[512], steamid[32];
    	GetClientAuthId(client, AuthId_Steam2, steamid, 32);
    [...]
    public void SQL_InsertPlayer_Callback(Database db, DBResultSet results, const char[] error, any data):

    Code:
    [...]
    	if (SQL_GetRowCount(results) == 0)
    	{
    		char steamid[64];
    		GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
    		SQL_RemoveVIP(steamid);
    	}
    [...]
    stock void CheckTimeLeft(int client):

    Code:
    [...]
    	char authid[64];
    	GetClientAuthId(client, AuthId_Steam2, authid, sizeof(authid));
    [...]


    GetClientAuthId gives a boolean value, check it before you use it? :'(

    Just like you did in:

    public void SQL_SelectPlayer_Callback(Database db, DBResultSet results, const char[] error, any data):

    Code:
    [...]
    	char steamid[32];
    	if (!GetClientAuthId(client, AuthId_Steam2, steamid, 32))
    	{
    		return;
    	}
    [...]
    Updated, Thanks.
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP
    BraveFox is offline
    Zyten
    Senior Member
    Join Date: Jan 2018
    Old 04-27-2018 , 17:55   Re: [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #7

    seems like name color not working
    also its stripped my root rights? after map change got them back after database removed alone?
    Dosent save database
    also vip connect/disconnect message spamm not going off and if u and add person to vip his name spamm under the 1st vip name also u cant put it off





    spamming my error logs this line:


    L 04/28/2018 - 00:52:23: SourceMod error session started
    L 04/28/2018 - 00:52:23: Info (map "jb_leaderminecraft_ll") (file "errors_20180428.log")
    L 04/28/2018 - 00:52:23: [csgovip.smx] [CSGOVIP] Client is not valid. Reason:

    Last edited by Zyten; 04-27-2018 at 21:01.
    Zyten is online now
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-28-2018 , 03:48   Re: [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #8

    Quote:
    Originally Posted by Zyten View Post
    seems like name color not working
    also its stripped my root rights? after map change got them back after database removed alone?
    Dosent save database
    also vip connect/disconnect message spamm not going off and if u and add person to vip his name spamm under the 1st vip name also u cant put it off





    spamming my error logs this line:


    L 04/28/2018 - 00:52:23: SourceMod error session started
    L 04/28/2018 - 00:52:23: Info (map "jb_leaderminecraft_ll") (file "errors_20180428.log")
    L 04/28/2018 - 00:52:23: [csgovip.smx] [CSGOVIP] Client is not valid. Reason:
    Try now, I've fixed some bugs in the mysql syntax and fixed the connect msg.
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP
    BraveFox is offline
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-28-2018 , 04:44   Re: [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #9

    Quote:
    3.2 - Fixed the bug which players's vip expires all the time
    New release!
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP

    Last edited by BraveFox; 04-28-2018 at 04:44.
    BraveFox is offline
    BraveFox
    AlliedModders Donor
    Join Date: May 2015
    Location: Israel
    Old 04-28-2018 , 04:48   Re: [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    Reply With Quote #10

    Quote:
    3.3 - Fixed a bug which crushes the server(player skins).
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP
    BraveFox is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 15:14.


    Powered by vBulletin®
    Copyright ©2000 - 2018, vBulletin Solutions, Inc.
    Theme made by Freecode