aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut')
-rw-r--r--Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut38
1 files changed, 38 insertions, 0 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut b/Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut
new file mode 100644
index 000000000..41d428484
--- /dev/null
+++ b/Northstar.CustomServers/scripts/vscripts/weapons/_team_emp.gnut
@@ -0,0 +1,38 @@
+global function TeamEMP_Init
+global function EMPEffects
+
+void function TeamEMP_Init()
+{
+ RegisterSignal( "PlayerEMPed" )
+}
+
+void function EMPEffects( entity player, float time )
+{
+ player.nv.empEndTime = Time() + time
+
+ player.Signal( "PlayerEMPed" )
+
+ // remember this is a stack so you need to enable as many times as you disable
+ DisableOffhandWeapons( player )
+
+ thread RecoverFromEMP( player, time )
+}
+
+void function RecoverFromEMP( entity player, float time )
+{
+ svGlobal.levelEnt.EndSignal( "BurnMeter_PreMatchEnter" )
+ player.EndSignal( "OnDestroy" )
+
+ OnThreadEnd(
+ function() : ( player )
+ {
+ if ( IsValid( player ) )
+ {
+ // remember this is a stack so you need to enable as many times as you disable
+ EnableOffhandWeapons( player )
+ }
+ }
+ )
+
+ wait time + 0.1
+} \ No newline at end of file