more randomness

This commit is contained in:
Wizzard 2023-07-30 02:24:22 -04:00
parent 0db25c708e
commit a8791a6477
1 changed files with 3 additions and 6 deletions

View File

@ -1,10 +1,6 @@
#include <sourcemod>
#include <tf2>
#define TOGGLE_TIME 250.0
#define MIN_FF_DURATION 120
#define MAX_FF_DURATION 270
public Plugin myinfo =
{
name = "Toggle Friendly Fire",
@ -28,7 +24,7 @@ public Action CmdToggleFriendlyFire(int client, int args)
{
if (CheckCommandAccess(client, "sm_friendlyfire", ADMFLAG_ROOT))
{
g_bPluginEnabled = !g_bPluginEnabled
g_bPluginEnabled = !g_bPluginEnabled;
if (g_bPluginEnabled)
{
@ -72,7 +68,8 @@ void StartToggleTimer()
if (timerToggle != null)
KillTimer(timerToggle);
timerToggle = CreateTimer(TOGGLE_TIME, ToggleFriendlyFire);
float randomToggleTime = GetRandomFloat(30.0, 600.0);
timerToggle = CreateTimer(randomToggleTime, ToggleFriendlyFire);
}
public Action ToggleFriendlyFire(Handle timer, any data)