Raised This Month: $7 Target: $400
 1% 

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


Post New Thread Closed Thread   
 
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
    Unapprover:
    Reason for Unapproving:
    No source code, upload source and use the Report Post button for a new review.
    Old 04-27-2018 , 15:25   [CSGO/CSS?] Upgraded & Fixed VIP System - On Database With Perks
    #1

    Use this system:
    https://forums.alliedmods.net/showth...52#post2647352
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests

    Last edited by BraveFox; 04-13-2019 at 09:51. Reason: Restore to previous version.
    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
    #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
    #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.
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests
    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
    #4

    Updated again the sourcecode.
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests
    BraveFox is offline
    DarkDeviL
    SourceMod Moderator
    Join Date: Apr 2012
    Old 04-27-2018 , 16:58   Re: [CSGO] Upgraded & Fixed VIP System - On Database With Perks
    #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].
    DarkDeviL 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
    #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.
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests
    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
    #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
    #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.
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests
    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
    #9

    Quote:
    3.2 - Fixed the bug which players's vip expires all the time
    New release!
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests

    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
    #10

    Quote:
    3.3 - Fixed a bug which crushes the server(player skins).
    __________________
    Contact Me:
    Steam: NoyB
    Discord: Noy#9999
    Taking Private Requests
    BraveFox is offline
    Closed Thread


    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 04:28.


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