Raised This Month: $404 Target: $400
 101% 

[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.8
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

    Please Delete.
    Attached Files
    File Type: zip csgovip-3.7.zip (38.8 KB, 388 views)
    File Type: zip csgovip-3.6.zip (38.4 KB, 20 views)
    File Type: zip csgovip-3.8.zip (38.4 KB, 389 views)
    __________________
    My Site
    My Public Plugins
    Donate Me
    Contact Me:
    Steam: S4muRaY'
    Taking Private Requests
    Develop SourcePawn, HTML, PHP

    Last edited by BraveFox; 10-13-2018 at 05:38.
    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 offline
    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 23:57.


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