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

Problem with cvars on a custom map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 03-07-2018 , 20:19   Problem with cvars on a custom map
Reply With Quote #1

Hi, i have this map on my server:
http://steamcommunity.com/sharedfile...?id=1241444522
The main problem is map sets mp_maxrounds for 300, but for some reasons i need to make this map lasts only 1 round, and after this round map ends, and fully restarts on this map again.
But i cant get it. On every round map again sets 300 rounds.
I tried this:
Handle hTimer;
ConVar cv;

#define COUNTTIME 20.0

public void OnPluginStart()
{
HookEvent("round_start", RoundStart);
cv = FindConVar("mp_maxrounds");
}

public void RoundStart(Event event, const char[] name, bool dbc)
{
if(hTimer != null)
{
KillTimer(hTimer);
hTimer = null;
}

hTimer = CreateTimer(COUNTTIME, cvTimer, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action cvTimer(Handle timer)
{
SetConVarInt(cv, 1);
}

But it sets maxrounds to 1, and instantly map backs it to 300...
Can i somehow strongly set maxrounds to 1 or remove this cvar from a map?

P.S mapconfigs plugin doesnt helped too.
waylander3 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 04:56.


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