Hello. I edited script to reset round counter (mp_restartgame or Round Draw) on CS:S and i want unrestrict sniper weapons, but .cfg on 4 round not executing... Can someone help me, please?
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
new Rounds;
new Handle:CvarRestartGame
public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) if(++Rounds == 3) ServerCommand("exec sourcemod/3sniperson.cfg");
public OnPluginStart()
{
HookEvent("round_start", round_start, EventHookMode_PostNoCopy);
CvarRestartGame = FindConVar("mp_restartgame");
HookConVarChange(CvarRestartGame, Change_RestartGame);
}
public Change_RestartGame(Handle:convar, const String:oldValue[], const String:newValue[])
{
if (StringToInt(newValue) > 0)
{
Rounds = 0;
}
}
public Action CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
if(reason == CSRoundEnd_Draw)
{
Rounds = 0;
}
else if(reason == CSRoundEnd_GameStart)
{
Rounds = 0;
}
}
public OnMapStart() Rounds = 0;
public round_start(Handle:event, const String:name[], bool:dontBroadcast) Rounds++;