Skip to content

Commit

Permalink
Add replay restart delay cvar (solves #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
shavitush committed Apr 25, 2016
1 parent cc32334 commit eaba734
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripting/shavit-replay.sp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ char gS_Map[128];

ConVar bot_quota = null;

// Plugin ConVars
ConVar gCV_ReplayDelay = null;

public Plugin myinfo =
{
name = "[shavit] Replay Bot",
Expand Down Expand Up @@ -90,6 +93,9 @@ public void OnPluginStart()

gF_Tickrate = (1.0 / GetTickInterval());

// plugin convars
gCV_ReplayDelay = CreateConVar("shavit_replay_delay", "1.5", "Time to wait before restarting the replay after it finishes playing.", FCVAR_PLUGIN, true, 0.0, true, 10.0);

// insert delete replay command here
}

Expand Down Expand Up @@ -458,7 +464,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
{
gI_ReplayTick[style] = -1;

CreateTimer(1.5, ResetReplay, style, TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(gCV_ReplayDelay.FloatValue, ResetReplay, style, TIMER_FLAG_NO_MAPCHANGE);

return Plugin_Continue;
}
Expand Down

0 comments on commit eaba734

Please sign in to comment.