more randomness
This commit is contained in:
parent
0db25c708e
commit
a8791a6477
|
@ -1,10 +1,6 @@
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <tf2>
|
#include <tf2>
|
||||||
|
|
||||||
#define TOGGLE_TIME 250.0
|
|
||||||
#define MIN_FF_DURATION 120
|
|
||||||
#define MAX_FF_DURATION 270
|
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
name = "Toggle Friendly Fire",
|
name = "Toggle Friendly Fire",
|
||||||
|
@ -28,7 +24,7 @@ public Action CmdToggleFriendlyFire(int client, int args)
|
||||||
{
|
{
|
||||||
if (CheckCommandAccess(client, "sm_friendlyfire", ADMFLAG_ROOT))
|
if (CheckCommandAccess(client, "sm_friendlyfire", ADMFLAG_ROOT))
|
||||||
{
|
{
|
||||||
g_bPluginEnabled = !g_bPluginEnabled
|
g_bPluginEnabled = !g_bPluginEnabled;
|
||||||
|
|
||||||
if (g_bPluginEnabled)
|
if (g_bPluginEnabled)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +68,8 @@ void StartToggleTimer()
|
||||||
if (timerToggle != null)
|
if (timerToggle != null)
|
||||||
KillTimer(timerToggle);
|
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)
|
public Action ToggleFriendlyFire(Handle timer, any data)
|
||||||
|
|
Loading…
Reference in New Issue