Spoiler
Quote:
Originally Posted by Nexd
PHP Code:
#include <sourcemod>
int RoundCount = 0;
native GameRules_GetProp(const String:prop[], size=4, element=0);
public void OnPluginStart() { HookEvent("round_start", Event_RoundStart); }
public void OnMapStart() { RoundCount=0; }
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { if (GameRules_GetProp("m_bWarmupPeriod") == 0) { RoundCount++; if(RoundCount == 10 || RoundCount == 20 || RoundCount == 30) { ServerCommand("sv_cheats 1"); } } else { RoundCount=0; } }
if its not working, edit this line:
PHP Code:
if(RoundCount == 10 || RoundCount == 20 || RoundCount == 30)
to 11 21 31 etc..
|
PHP Code:
#include <sourcemod>
#include <sdktools>
int RoundCount = 0;
ConVar RestartGame;
/// native GameRules_GetProp(const String:prop[], size=4, element=0);
public void OnPluginStart()
{
RegAdminCmd("sm_rr", RR, ADMFLAG_GENERIC)
HookEvent("round_start", Event_RoundStart);
RestartGame = CreateConVar("mp_restartgame", "1");
HookConVarChange(RestartGame, Detected);
AutoExecConfig(true, "botbenson_strip", "sourcemod");
}
public void OnMapStart()
{
RoundCount = 0;
}
public Detected(ConVar convar, const char[] oldValue, const char[] newValue)
{
RoundCount = 0;
}
public Action RR(client, args)
{
ServerCommand("mp_restartgame 1");
RoundCount = 0;
}
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
if (GameRules_GetProp("m_bWarmupPeriod") == 0)
{
RoundCount++;
if(RoundCount != 10 && RoundCount != 20 && RoundCount != 30 && RoundCount != 40 && RoundCount != 50 && RoundCount != 60) {
ServerCommand("sm_strip @all 2");
}
}
else
{
RoundCount=0;
}
}
I think it will work this way
__________________