Skip to content

Commit 5390d8a

Browse files
v1.1
- Fix syntax on CreateTimer() - Fix syntax like float 2 -> 2.0
1 parent a0641a4 commit 5390d8a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed
-63 Bytes
Binary file not shown.

scripting/TF2Sandbox-SecurityLaser.sp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define DEBUG
44

55
#define PLUGIN_AUTHOR "BattlefieldDuck"
6-
#define PLUGIN_VERSION "1.0"
6+
#define PLUGIN_VERSION "1.1"
77

88
#include <sourcemod>
99
#include <sdktools>
@@ -82,7 +82,7 @@ public void OnMapStart()
8282

8383
if (StrEqual(strModel, MODEL_POINTER))
8484
{
85-
CreateTimer(0.0, Timer_SecurityLaser, EntIndexToEntRef(index));
85+
CreateTimer(cvfRefreshRate.FloatValue, Timer_SecurityLaser, EntIndexToEntRef(index), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
8686
}
8787
}
8888
}
@@ -104,7 +104,7 @@ public void OnLaserPointerSpawn(int entity)
104104

105105
if (StrEqual(strModel, MODEL_POINTER))
106106
{
107-
CreateTimer(0.0, Timer_SecurityLaser, EntIndexToEntRef(entity));
107+
CreateTimer(cvfRefreshRate.FloatValue, Timer_SecurityLaser, EntIndexToEntRef(entity), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
108108
}
109109
}
110110
}
@@ -126,7 +126,7 @@ public Action Timer_SecurityLaser(Handle timer, int pointerref)
126126
int pointer = EntRefToEntIndex(pointerref);
127127
if (pointer == INVALID_ENT_REFERENCE)
128128
{
129-
return Plugin_Continue;
129+
return Plugin_Stop;
130130
}
131131

132132
float fpointerpos[3], fpointerang[3];
@@ -142,11 +142,9 @@ public Action Timer_SecurityLaser(Handle timer, int pointerref)
142142
int g_iLaserColor[4];
143143
GetEntityRenderColor(pointer, g_iLaserColor[0], g_iLaserColor[1], g_iLaserColor[2], g_iLaserColor[3]);
144144

145-
TE_SetupBeamPoints(fpointerpos, GetPointAimPosition(fpointerpos, fpointerang, 999999.9, pointer), g_iModelIndex[iSkin], g_iHaloIndex[iSkin], 0, 0, cvfRefreshRate.FloatValue*2, fSize, fSize, 0, 0.0, g_iLaserColor, 0);
145+
TE_SetupBeamPoints(fpointerpos, GetPointAimPosition(fpointerpos, fpointerang, 999999.9, pointer), g_iModelIndex[iSkin], g_iHaloIndex[iSkin], 0, 0, cvfRefreshRate.FloatValue*2.0, fSize, fSize, 0, 0.0, g_iLaserColor, 0);
146146
TE_SendToAll();
147147

148-
CreateTimer(cvfRefreshRate.FloatValue, Timer_SecurityLaser, pointerref);
149-
150148
return Plugin_Continue;
151149
}
152150

0 commit comments

Comments
 (0)