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

[CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Focus Nation
Member
Join Date: Nov 2020
Old 11-19-2020 , 15:02   [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #1

I got this plugin that is kind of glitchy and I can't set the cvar to 0 unless I type it in console so I tried adding it to my .cfg's but that didn't work so I need some plugin that types out in console "cvar 0" or what ever the cvar name is. Can't find a plugin like this can anyone send me ?
__________________

Focus Nation is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 11-19-2020 , 15:36   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=2334694
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
Focus Nation
Member
Join Date: Nov 2020
Old 11-19-2020 , 16:45   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #3

Quote:
Originally Posted by SSheriFF View Post
Thanks this doesn't seem to work tho :/
Don't know why
__________________

Focus Nation is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 11-19-2020 , 17:17   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #4

If you send the source to the plugin you can change the default value in the plugin source or let us know what command you want to run OnMapStart.
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
Focus Nation
Member
Join Date: Nov 2020
Old 11-19-2020 , 18:05   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #5

If you take a look at the highlighted stuff it's set to 0 but still comes out as 1 on server.

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <csgocolors>
#include <sdkhooks>
#include <clientprefs>

#undef REQUIRE_EXTENSIONS
#tryinclude <dhooks>
#define REQUIRE_EXTENSIONS

#pragma newdecls required

#define PLUGIN_VERSION "2.2.1"

//Maximum amount of definitions allowed.
#define MAX_DEFINED_COLORS 128
#define MAX_DEFINED_MATERIALS 128
#define MAX_DEFINED_WIDTHS 128
#define MAX_DEFINED_LIFES 128
#define MAX_DEFINED_ALPHAS 128

#define INDEX_COLOR 0
#define INDEX_WIDTH 1
#define INDEX_ALPHA 2
#define INDEX_LIFE 3
#define INDEX_MATERIAL 4
#define INDEX_VISIBLE 5
#define INDEX_TOTAL 6

#define VISIBLE_ONE 0
#define VISIBLE_TEAM 1
#define VISIBLE_ALL 2

#define TRACERS_DISABLED 0
#define TRACERS_ENABLED 1
#define TRACERS_FORCED 2

#define KNIFE_PRIMARY 1
#define KNIFE_SECONDARY 2

#define MASK_SOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE)

int g_iLoadColors, g_iLoadMaterials, g_iLoadConfigs;

//Colors
int g_iNumColors;
char g_sColorSchemes[MAX_DEFINED_COLORS][32];
char g_sColorNames[MAX_DEFINED_COLORS][64];
int g_iColorFlag[MAX_DEFINED_COLORS];

//Materials
int g_iMaterials;
char g_sMaterialPaths[MAX_DEFINED_MATERIALS][256];
char g_sMaterialNames[MAX_DEFINED_MATERIALS][64];
int g_iMaterialIndexes[MAX_DEFINED_MATERIALS];
int g_iMaterialFlag[MAX_DEFINED_MATERIALS];

//Configs
int g_iNumWidths, g_iNumAlphas, g_iNumLifes;
float g_fWidths[MAX_DEFINED_WIDTHS];
int g_iAlphas[MAX_DEFINED_ALPHAS];
float g_fLifeTimes[MAX_DEFINED_LIFES];

Handle g_hEnabled = null;
Handle g_hFlag = null;
Handle g_hDefault = null;
Handle g_hKnife = null;
Handle g_hChatCommands = null;
Handle g_hDefaultColor = null;
Handle g_hDefaultLifeTime = null;
Handle g_hDefaultWidth = null;
Handle g_hDefaultAlpha = null;
Handle g_hDefaultMaterial = null;
Handle g_hDefaultVisible = null;
Handle g_hConfigColor = null;
Handle g_hConfigLifeTime = null;
Handle g_hConfigWidth = null;
Handle g_hConfigAlpha = null;
Handle g_hConfigMaterial = null;
Handle g_hConfigVisible = null;
Handle g_hGrenadeTrails = null;
Handle g_cEnabled = null;
Handle g_cColor = null;
Handle g_cWidth = null;
Handle g_cAlpha = null;
Handle g_cLifeTime = null;
Handle g_cMaterial = null;
Handle g_cVisible = null;
Handle g_hConfig = null;
#if defined _dhooks_included
Handle g_hPrimaryAttack = null;
Handle g_hSecondaryAttack = null;
#endif

int g_iTeam[MAXPLAYERS+1];
bool g_bAlive[MAXPLAYERS+1];
bool g_bLoaded[MAXPLAYERS+1];
bool g_bValid[MAXPLAYERS+1];
bool g_bFake[MAXPLAYERS+1];
bool g_bKnife[MAXPLAYERS+1];
int g_iAppear[MAXPLAYERS+1];
int g_iColors[MAXPLAYERS+1][4];
int g_iTracerData[MAXPLAYERS+1][INDEX_TOTAL];

int g_iProjTrail[2048];

int g_iDefault, g_iDefaultColor, g_iDefaultLifeTime, g_iDefaultWidth, g_iDefaultAlpha, g_iDefaultMaterial, g_iDefaultVisible, g_iAccessFlag, g_iNumCommands, g_iKnife;
bool g_bEnabled, g_bLateLoad, g_bConfigColor, g_bConfigLifeTime, g_bConfigWidth, g_bConfigAlpha, g_bConfigMaterial;
bool g_bConfigVisible, g_bDynamicHooks, g_bGrenadeTrails, g_bLoadedHooks;
char g_sPrefixChat[32], g_sPrefixSelect[16], g_sPrefixEmpty[16], g_sChatCommands[16][32];

public Plugin myinfo =
{
	name = "[CS:GO] Supporter Tracers", 
	author = "Twisted|Panda & Neoxx", 
	description = "Provides both simple and advanced functionality for displaying tracers - beams that expand from muzzle to bullet impact - focused on players.", 
	version = PLUGIN_VERSION, 
	url = "https://forums.alliedmods.net/showthread.php?p=2302364"
}

public void OnAllPluginsLoaded()
{
	g_bDynamicHooks = LibraryExists("dhook");
	if(g_bDynamicHooks && !g_bLoadedHooks)
	{
		#if defined _dhooks_included
		if(g_hConfig == null)
		{
			char sPath[PLATFORM_MAX_PATH];
			BuildPath(Path_SM, sPath, sizeof(sPath), "gamedata/supporter_tracers.txt");
			if(FileExists(sPath))
				g_hConfig = LoadGameConfigFile("supporter_tracers.gamedata");
		}		
		if(g_hConfig != null)
		{
			g_bLoadedHooks = true;
			int iPrimary = GameConfGetOffset(g_hConfig, "PrimaryAttack");
			g_hPrimaryAttack = DHookCreate(iPrimary, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, PrimaryAttack);
			int iSecondary = GameConfGetOffset(g_hConfig, "SecondaryAttack");
			g_hSecondaryAttack = DHookCreate(iSecondary, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, SecondaryAttack);
		}
		else
			g_bDynamicHooks = g_bLoadedHooks = false;
		#endif
	}
}
 
public void OnLibraryRemoved(const char[] name)
{
	if (StrEqual(name, "dhook"))
	{
		g_bDynamicHooks = g_bLoadedHooks = false;
	}
}
 
public void OnLibraryAdded(const char[] name)
{
	if (StrEqual(name, "dhook") && !g_bLoadedHooks)
	{
		#if defined _dhooks_included
		if(g_hConfig == null)
		{
			char sPath[PLATFORM_MAX_PATH];
			BuildPath(Path_SM, sPath, sizeof(sPath), "gamedata/supporter_tracers.txt");
			if(FileExists(sPath))
				g_hConfig = LoadGameConfigFile("supporter_tracers.gamedata");
		}
		if(g_hConfig != null)
		{
			g_bLoadedHooks = g_bDynamicHooks = true;
			int iPrimary = GameConfGetOffset(g_hConfig, "PrimaryAttack");
			g_hPrimaryAttack = DHookCreate(iPrimary, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, PrimaryAttack);
			int iSecondary = GameConfGetOffset(g_hConfig, "SecondaryAttack");
			g_hSecondaryAttack = DHookCreate(iSecondary, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, SecondaryAttack);
		}
		else
			g_bDynamicHooks = g_bLoadedHooks = false;
		#endif
	}
}

public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
	g_bLateLoad = late;
	return APLRes_Success;
}

public void OnPluginStart()
{
	LoadTranslations("common.phrases");
	LoadTranslations("supporter_tracers.phrases");

	CreateConVar("tracers_version", PLUGIN_VERSION, "Supporter Tracers: Version", FCVAR_SPONLY|FCVAR_CHEAT|FCVAR_NOTIFY|FCVAR_DONTRECORD);
	g_hEnabled = CreateConVar("tracers_enabled", "1", "Enables/Disables all features of this plugin.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hEnabled, OnSettingsChange);
	g_hFlag = CreateConVar("tracers_access", "", "If \"\", everyone can use Tracers, otherwise, only players with this flag or the \"Tracers_Access\" override can access.", FCVAR_NONE);
	HookConVarChange(g_hFlag, OnSettingsChange);
	g_hDefault = CreateConVar("tracers_default_status", "2", "The default tracer status that is set to new clients. (0 = Disabled, 1 = Enabled, 2 = Always Enabled)", FCVAR_NONE, true, 0.0, true, 2.0);
	HookConVarChange(g_hDefault, OnSettingsChange);
	g_hKnife = CreateConVar("tracers_knife", "0", "If enabled, clients with access can shoot tracers from their knife to their crosshair location. (0 = Disabled, 1 = Left Click, 2 = Right Click, 3 = Both)", FCVAR_NONE, true, 0.0, true, 3.0);
	HookConVarChange(g_hKnife, OnSettingsChange);
	g_hChatCommands = CreateConVar("tracers_commands", "!tracer, !tracers, /tracer, /tracers, !laser, !lasers, /laser, /lasers", "The chat triggers available to clients to access tracers features.", FCVAR_NONE);
	HookConVarChange(g_hChatCommands, OnSettingsChange);

	g_hDefaultColor = CreateConVar("tracers_default_color", "-1", "The default color index to be applied to new players or upon tracers_config_color being set to 0. (-1 = Random, # = Index)", FCVAR_NONE, true, -1.0);
	HookConVarChange(g_hDefaultColor, OnSettingsChange);
	g_hDefaultLifeTime = CreateConVar("tracers_default_lifetime", "4", "The default lifetime index to be applied to new players or upon tracers_config_lifetime being set to 0 (-1 = Random, # = Index)", FCVAR_NONE, true, -1.0);
	HookConVarChange(g_hDefaultLifeTime, OnSettingsChange);
	g_hDefaultWidth = CreateConVar("tracers_default_width", "12", "The default width index to be applied to new players or upon tracers_config_width being set to 0 (-1 = Random, # = Index)", FCVAR_NONE, true, -1.0);
	HookConVarChange(g_hDefaultWidth, OnSettingsChange);
	g_hDefaultAlpha = CreateConVar("tracers_default_alpha", "5", "The default alpha index to be applied to new players or upon tracers_config_alpha being set to 0 (-1 = Random, # = Index)", FCVAR_NONE, true, -1.0);
	HookConVarChange(g_hDefaultAlpha, OnSettingsChange);
	g_hDefaultMaterial = CreateConVar("tracers_default_material", "9", "The default material index to be applied to new players or upon tracers_config_material being set to 0 (-1 = Random, # = Index)", FCVAR_NONE, true, -1.0);
	HookConVarChange(g_hDefaultMaterial, OnSettingsChange);
	g_hDefaultVisible = CreateConVar("tracers_default_visible", "2", "The default visibility index applied to new players. (0 = Player Only, 1 = Team Only, 2 = All)", FCVAR_NONE, true, 0.0, true, 2.0);
	HookConVarChange(g_hDefaultVisible, OnSettingsChange);
	g_hConfigColor = CreateConVar("tracers_config_color", "1", "If enabled, clients will be able to change the color of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigColor, OnSettingsChange);
	g_hConfigLifeTime = CreateConVar("tracers_config_lifetime", "0", "If enabled, clients will be able to change the lifetime of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigLifeTime, OnSettingsChange);
	g_hConfigWidth = CreateConVar("tracers_config_width", "0", "If enabled, clients will be able to change the width of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigWidth, OnSettingsChange);
	g_hConfigAlpha = CreateConVar("tracers_config_alpha", "0", "If enabled, clients will be able to change the alpha value of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigAlpha, OnSettingsChange);
	g_hConfigMaterial = CreateConVar("tracers_config_material", "1", "If enabled, clients will be able to change the material of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigMaterial, OnSettingsChange);
	g_hConfigVisible = CreateConVar("tracers_config_visible", "0", "If enabled, clients will be able to change the visibility status of their tracer.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hConfigVisible, OnSettingsChange);
	g_hGrenadeTrails = CreateConVar("tracers_grenades", "0", "If enabled, grenades thrown by clients will have their trail attached.", FCVAR_NONE, true, 0.0, true, 1.0);
	HookConVarChange(g_hGrenadeTrails, OnSettingsChange);
	AutoExecConfig(true, "supporter_tracers");
This is only a part of the .sp file.
And yes I have compiled this and added the smx file to plugin still shows as "tracers_config_width" "1" any ideas?
__________________


Last edited by DarkDeviL; 11-20-2020 at 04:59. Reason: Changed from QUOTE to CODE tags
Focus Nation is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-19-2020 , 20:53   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #6

1. Your plugin uses this line of code: AutoExecConfig(true, "supporter_tracers");

2. Look for file called supporter_tracers.cfg (most likely in /cfg/sourcemod/supporter_tracers.cfg

3. Edit the convar settings in that file it to your liking.

4. Change map.

5. Problem fixed.

At least, that's my theory anyway. Not tested since I don't play CS:GO.
PC Gamer is offline
Focus Nation
Member
Join Date: Nov 2020
Old 11-19-2020 , 21:45   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #7

Quote:
Originally Posted by PC Gamer View Post
1. Your plugin uses this line of code: AutoExecConfig(true, "supporter_tracers");

2. Look for file called supporter_tracers.cfg (most likely in /cfg/sourcemod/supporter_tracers.cfg

3. Edit the convar settings in that file it to your liking.

4. Change map.

5. Problem fixed.

At least, that's my theory anyway. Not tested since I don't play CS:GO.
Thanks for your reply, seems it works now all of a sudden, also that .cfg you mention doesn't have any options to change it to enable or disable but anyway its all good now!
__________________

Focus Nation is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 11-20-2020 , 12:03   Re: [CS:GO/ANY] Looking for a plugin that disables / changes cvar on map change.
Reply With Quote #8

Glad to see its not working! Your plugin was loading the .cfg in the sourcemod folder. To make changes to any values directly edit the /cfg/sourcemod/supporter_tracers.cfg file.
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman 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 03:35.


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