Raised This Month: $51 Target: $400
 12% 

Edit cvars during warmup round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-24-2017 , 23:33   Edit cvars during warmup round?
Reply With Quote #1

I am trying to find a way to edit cvars during warmup round so I can allow players to have unlimited cash during warmup round and they can buy anywhere. I figured that execute configs 1.0 by DJ Tsunami would work but it doesn't seem to have an option to target warmup rounds. I have tried to post on the thread but can't seem to get an answer as to how to change cvars with the plugin. I have even tried to change my default cvars in my gamemode_competitive_server.cfg and then change them back to what they normally should be when round 1 is triggered. Any help would be greatly appreciated!

Thanks,
lowheartrate
__________________
lowheartrate is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 04-25-2017 , 01:51   Re: Edit cvars during warmup round?
Reply With Quote #2

Why don't you create an extra cfg file like warmup.cfg and execure it though admin menu? and even another config file to restore default values of those changed convars, does this really require a plugin?
__________________
ambn is offline
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-25-2017 , 01:56   Re: Edit cvars during warmup round?
Reply With Quote #3

Quote:
Originally Posted by ambn View Post
Why don't you create an extra cfg file like warmup.cfg and execure it though admin menu? and even another config file to restore default values of those changed convars, does this really require a plugin?
How would I go about executing warmup.cfg during warmup and then executing the other after warmup ends. I would like it to be done automatically as I am not always in the server 24/7 to do it.
__________________

Last edited by lowheartrate; 04-25-2017 at 03:30.
lowheartrate is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 04-25-2017 , 03:37   Re: Edit cvars during warmup round?
Reply With Quote #4

Ok then well! you can execute warmup.cfg file just OnMapStart, playerjoin etc, then you may probably CreateTimer to check whether it is warmup or not (https://forums.alliedmods.net/showthread.php?t=296560), then if it wasn't just execute normal config.
__________________
ambn is offline
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-25-2017 , 03:57   Re: Edit cvars during warmup round?
Reply With Quote #5

Quote:
Originally Posted by ambn View Post
Ok then well! you can execute warmup.cfg file just OnMapStart, playerjoin etc, then you may probably CreateTimer to check whether it is warmup or not (https://forums.alliedmods.net/showthread.php?t=296560), then if it wasn't just execute normal config.
How would I go about executing a certain file from my cfg/ folder in this code?!
PHP Code:
if (GameRules_GetProp("m_bWarmupPeriod") == 1

            
// warmup ON 

__________________
lowheartrate is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 04-25-2017 , 04:08   Re: Edit cvars during warmup round?
Reply With Quote #6

not sure but this may probably work:
PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

ConVar CFGWarm null;
ConVar CFGNorm null;
Handle Timer_Check INVALID_HANDLE;

public 
Plugin myinfo 
{
    
name        "CFG Auto Executer",
    
author      "noBrain",
    
description "Execute Configs Automatcally",
    
version     "1.0",
};

public 
void OnPluginStart()
{
    
CFGWarm CreateConVar("sm_warmup_cfg""warmup.cfg");
    
CFGNorm CreateConVar("sm_normal_cfg""server.cfg");
}
public 
void OnMapStart()
{
    
Timer_Check CreateTimer(2.0Warmup_Check_TIMER_REPEAT);
    
CreateTimer(1.0Warmup_Exec);
}
public 
Action Warmup_Exec(Handle timer)
{
    
char CFGWarmName[32];
    
GetConVarString(CFGWarmCFGWarmNamesizeof(CFGWarmName));
    
ServerCommand("exec %s"CFGWarmName);
    
PrintToServer("[SM] Warmup config has executed!");
}
public 
Action Warmup_Check(Handle timer)
{
    if (
GameRules_GetProp("m_bWarmupPeriod") == 1
    {
        
char CFGNormName[32];
        
GetConVarString(CFGNormCFGNormNamesizeof(CFGNormName));
        
ServerCommand("exec %s"CFGNormName);
        
PrintToServer("[SM] Normal config has executed!");
        
KillTimer(Timer_Check);
    }

You should just change those 2 convars to your config names located into csgo/cfg folder
__________________

Last edited by ambn; 04-25-2017 at 04:10.
ambn is offline
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-25-2017 , 04:18   Re: Edit cvars during warmup round?
Reply With Quote #7

Quote:
Originally Posted by ambn View Post
not sure but this may probably work:
Spoiler

You should just change those 2 convars to your config names located into csgo/cfg folder
I created a warmup.cfg file in the cfg/ directory and put in the cvars I want during warmup round and fired up the plugin in the server which looks to have loaded just fine but it didn't change any cvars in the server
__________________
lowheartrate is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 04-25-2017 , 04:26   Re: Edit cvars during warmup round?
Reply With Quote #8

Quote:
Originally Posted by lowheartrate View Post
I created a warmup.cfg file in the cfg/ directory and put in the cvars I want during warmup round and fired up the plugin in the server which looks to have loaded just fine but it didn't change any cvars in the server
I think you have misunderstood, the cfg files get executed OnMapStart which means it won't work on loading the plugin, you may probably want to change map to see if it works or not?
__________________
ambn is offline
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-25-2017 , 14:04   Re: Edit cvars during warmup round?
Reply With Quote #9

Quote:
Originally Posted by ambn View Post
I think you have misunderstood, the cfg files get executed OnMapStart which means it won't work on loading the plugin, you may probably want to change map to see if it works or not?
I tried to also change the map and get the same response.... nothing.
__________________
lowheartrate is offline
lowheartrate
Member
Join Date: Apr 2015
Location: United States, New York
Old 04-25-2017 , 22:06   Re: Edit cvars during warmup round?
Reply With Quote #10

I figured out a way for it to work with the plugin Execute Configs by DJ Tsunami. For some reason warmup round was being targeted with "round:1". Although I tried that before I must have been doing something wrong with calling it. Although this kind of works now there is still an issue I am having currently.

I have the plugin executing cfg/warmup.cfg at round:1 which has the following cvars in it:
Code:
mp_buy_anywhere 1
mp_maxmoney 65535
mp_startmoney 65535
mp_solid_teammates 0
... and then I have cfg/round1.cfg being executed at round:2 which should change the cvars to:
Code:
mp_buy_anywhere 0
mp_maxmoney 16000
mp_startmoney 800
mp_solid_teammates 1
When round 2 comes along it seems to change the mp_solid_teammates & mp_buy_anywhere cvars just fine but when starting the round the player(s) still have maximum money allowed which in this case is $16000 so there really is no initial pistol round, it's just a full gun on gun battle straight from round one.
__________________
lowheartrate is offline
Reply



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 07:53.


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