Raised This Month: $32 Target: $400
 8% 

[CS:GO] VIP System


Post New Thread Reply   
 
Thread Tools Display Modes
AG.1436
Junior Member
Join Date: Feb 2019
Location: in front of this screen
Old 04-18-2019 , 06:49   Re: [CS:GO/CSS?] VIP System
Reply With Quote #21

Quote:
You mean to add the option to give the VIP users a flag (such as: b,c,a) ?
I would love to see that so that VIP dont need to connect by console
AG.1436 is offline
Summer Solder
Junior Member
Join Date: May 2018
Location: New Delhi, India
Old 04-18-2019 , 07:01   Re: [CS:GO/CSS?] VIP System
Reply With Quote #22

Quote:
Originally Posted by BraveFox View Post
Have you changed the convar in the config file (cfg/sourcemod/plugin.VIPCore.cfg) ?
Yes, I have changed in the CFG. Here are my changes
sm_vip_table_prefix "test_vip"

but in my db, I only have vipUsers table, not test_vipUsers.
__________________
Admin at Gang Gaming
-------------------------------
My Plugins
VMPanel
NonPrimePlayerKicker
CSGO Advanced Custom Rounds
-------------------------------
Github: Summer Soldier
Discord: Summer_Soldier#5591
Summer Solder is offline
lemonpaka
Member
Join Date: Sep 2018
Location: China
Old 04-18-2019 , 12:01   Re: [CS:GO/CSS?] VIP System
Reply With Quote #23

Quote:
Originally Posted by BraveFox View Post
Have you changed the convar in the config file (cfg/sourcemod/plugin.VIPCore.cfg) ?



I will consider it, I see much people who use hextags I might make the system compact with the hextags.



You mean to add the option to give the VIP users a flag (such as: b,c,a) ?
yes, and if there is a feature about user can active thier VIP via A key will be great.(I already done it by myself...)
now I only want that Flag Add.. thank you again
issue : can't change namecolor
sorry about my terrible english

Last edited by lemonpaka; 04-19-2019 at 01:56.
lemonpaka is offline
Frenzi3d
Member
Join Date: Nov 2018
Location: Thailand
Old 04-19-2019 , 02:49   Re: [CS:GO/CSS?] VIP System
Reply With Quote #24

I set

sm_vip_pistol to 0

but still show select pistol

And how to edit VIP HP Health ?

fix please.

Last edited by Frenzi3d; 04-19-2019 at 03:22.
Frenzi3d is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 04-19-2019 , 04:15   Re: [CS:GO/CSS?] VIP System
Reply With Quote #25

Update:

Added cvar to give the vip flags (sm_vip_flags),
Fixed the bug with the pistol menu.
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 04-19-2019 , 04:17   Re: [CS:GO/CSS?] VIP System
Reply With Quote #26

Quote:
Originally Posted by Summer Solder View Post
Yes, I have changed in the CFG. Here are my changes
sm_vip_table_prefix "test_vip"

but in my db, I only have vipUsers table, not test_vipUsers.
I've checked myself, works good I didn't have any problem with it.

Quote:
Originally Posted by lemonpaka View Post
yes, and if there is a feature about user can active thier VIP via A key will be great.(I already done it by myself...)
now I only want that Flag Add.. thank you again
issue : can't change namecolor
sorry about my terrible english
Everything works good in my testing server, can you change the text colors and the tag color ?
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 04-19-2019 , 04:22   Re: [CS:GO/CSS?] VIP System
Reply With Quote #27

Update:
Changed the health cvar, instead of disable/enable you can set the amount or set to 0 to disable.
sm_vip_health - Amount of health bonus, 0 = Disable
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
lemonpaka
Member
Join Date: Sep 2018
Location: China
Old 04-19-2019 , 04:33   Re: [CS:GO/CSS?] VIP System
Reply With Quote #28

Quote:
Originally Posted by BraveFox View Post
I've checked myself, works good I didn't have any problem with it.



Everything works good in my testing server, can you change the text colors and the tag color ?
only namecolor have issue(server with warmod)....other works well
one more quesion...why not change arms with skins?

Last edited by lemonpaka; 04-19-2019 at 13:58.
lemonpaka is offline
miXXed
Member
Join Date: Sep 2015
Old 04-19-2019 , 08:36   Re: [CS:GO/CSS?] VIP System
Reply With Quote #29

sm_vip_pistol 1 - the pistol function is very good, but not for RETAKES servers..

can you make that the selected Pistol will be saved for the gamesession ?
a round on retakes can be played in 15 seconds.. and always showing up the pistol menu... would be nice if there
is a way to fix it.. instead of disable vip pistol menu.. maybe !vp ? "Vip Pistol"

i have tested any other stuff evrythign works great.
hope you can make somthing about the Pistol..
miXXed is offline
lemonpaka
Member
Join Date: Sep 2018
Location: China
Old 04-19-2019 , 11:41   Re: [CS:GO/CSS?] VIP System
Reply With Quote #30

I just added a feature what I need about player can activate their own VIP via A Key, if someone need it just compile plugin with this code, and then what you need to do just generator keys and uplod it to MySQL.(not tested that code about table creation for KEYS, but I think it should work, because at first I create KEY table manualy)
Code:
public void OnPluginStart()
{
	LoadTranslations("common.phrases");
	
	g_cHealthBonus = CreateConVar("sm_vip_health", "10", "Health bonus amount, 0 = Disable", 0, true, 0.0);
	g_cArmorBonus = CreateConVar("sm_vip_armor", "1", "Enable the armor bonus? 0 = Disable, 1 = Enable", 0, true, 0.0, true, 1.0);
	g_cPistolBonus = CreateConVar("sm_vip_pistol", "1", "Enable the pistol bonus? 0 = Disable, 1 = Enable", 0, true, 0.0, true, 1.0);
	g_cPlayerSkins = CreateConVar("sm_vip_skins", "1", "Enable the player skins? 0 = Disable, 1 = Enable", 0, true, 0.0, true, 1.0);
	g_cTablePrefix = CreateConVar("sm_vip_table_prefix", "vip", "Prefix for the database table (Default: vip)");
	g_cVipFlags = CreateConVar("sm_vip_flags", "", "Flags to give the vip users, empty for nothing");
	
	AutoExecConfig();
	
	SQL_MakeConnection(); //The table cvar required in here
	
	g_aBlockedTags = new ArrayList(64);
	
	HookEvent("player_spawn", Event_PlayerSpawn);
	HookEvent("round_start", Event_RoundStart);
	
	RegAdminCmd("sm_addvip", Command_AddVIP, ADMFLAG_ROOT, "Gives a vip access");
	RegAdminCmd("sm_removevip", Command_RemoveVIP, ADMFLAG_ROOT, "Removes a vip access");
	RegConsoleCmd("sm_vip", Command_VIPMenu, "Opens the vip menu");
	RegConsoleCmd("sm_getvip",Command_GetVIP,"Get VIP via A key");
}
Code:
public Action Command_GetVIP(int client, int args)
{
	if (args != 1)
	{
		ReplyToCommand(client, "%s Usage: sm_getvip <cdkey>", PREFIX);
		return Plugin_Handled;
	}
	char szArg[512];
	char query[512];
	char szQuery[512];
	GetCmdArg(1, szArg, sizeof(szArg));
	Format(query, sizeof(query),"SELECT DAYS FROM vipCode WHERE VIPKEY='%s';", szArg);
	g_dDatabase.Query(DaysCallBack,query,client)
	FormatEx(szQuery, sizeof(szQuery), "DELETE FROM `vipCode` WHERE `VIPKEY` = '%s'", szArg);
	g_dDatabase.Query(SQL_CheckForErrors, szQuery, client);
	return Plugin_Handled;
}
public void DaysCallBack(Database db, DBResultSet results, const char[] error, any data)
{
	int client = data;
	if (results.FetchRow())
	{
	int iDays = results.FetchInt(0);
	if(iDays>0)
	{
	char szStamp[512];
	char szNewStamp[512];
	Format(szStamp, sizeof(szStamp), "%i", GetTime() + (iDays * 86400));
	Format(szNewStamp, sizeof(szNewStamp), "%i", GetTime() + ((iDays+g_iDaysLeft[client]) * 86400));
	PrintToChat(client, "%s Trying to give \x02%N \x01a vip access...", client);
	char szQuery[512];
	if (g_bVIP[client])
		FormatEx(szQuery, sizeof(szQuery), "UPDATE `vipUsers` SET `expireStamp`= '%s' WHERE `authId` = '%s'", szNewStamp, g_szAuth[client]);
	else
		FormatEx(szQuery, sizeof(szQuery), "INSERT INTO `vipUsers` (`authId`, `expireStamp`) VALUES ('%s', '%s')", g_szAuth[client], szStamp);
	g_dDatabase.Query(SQL_CheckForErrors, szQuery, GetClientSerial(client));
	
	SQL_FetchUser(client);
	PrintToChat(client, "%s Successfully gave \x02%N \x01a vip access...", PREFIX, client);
	}
	}
	else
	{
		PrintToChat(client, "%s invalid key", PREFIX);
	}
}
Code:
void SQL_MakeConnection()
{
	if (g_dDatabase != null)
		delete g_dDatabase;
	
	char szError[512];
	g_dDatabase = SQL_Connect("vip", true, szError, sizeof(szError));
	if (g_dDatabase == null)
	{
		SetFailState("Cannot connect to datbase error: %s", szError);
	}
	
	char szPrefix[512];
	g_cTablePrefix.GetString(szPrefix, sizeof(szPrefix));
	
	char szQuery[512];
	char szQuery2[512];
	char szQuery3[512];
	FormatEx(szQuery, sizeof(szQuery), "CREATE TABLE IF NOT EXISTS `%sUsers` (`authId` VARCHAR(32) NOT NULL, `expireStamp` INT NOT NULL, UNIQUE (`authId`));", szPrefix);
	g_dDatabase.Query(SQL_CheckForErrors, szQuery);
	FormatEx(szQuery2, sizeof(szQuery), "CREATE TABLE IF NOT EXISTS `%sPerks`(`authId` VARCHAR(32) NOT NULL PRIMARY KEY, `chatTag` VARCHAR(512) NOT NULL DEFAULT '', `clanTag` VARCHAR(512) NOT NULL DEFAULT '', `tagColor` VARCHAR(16) NOT NULL DEFAULT '', `nameColor` VARCHAR(16) NOT NULL DEFAULT '', `chatColor` VARCHAR(16) NOT NULL DEFAULT '', `hpBonus` INT(10) NOT NULL DEFAULT 0, `armorBonus` INT(10) NOT NULL DEFAULT 0, `tSkin` VARCHAR(512) NOT NULL DEFAULT '', `ctSkin` VARCHAR(512) NOT NULL DEFAULT '',UNIQUE (`authId`))", szPrefix);
	g_dDatabase.Query(SQL_CheckForErrors, szQuery2);
	FormatEx(szQuery3, sizeof(szQuery), "CREATE TABLE IF NOT EXISTS `%sCode`(`VIPKEY` VARCHAR(32) NOT NULL, `DAYS` INT(10) NOT NULL DEFAULT 30)", szPrefix);
	g_dDatabase.Query(SQL_CheckForErrors, szQuery3);
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i))
			OnClientPostAdminCheck(i);
	}
}
lemonpaka 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:03.


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