aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/weapons/_team_emp.gnut
blob: 41d4284843d169852f67d7abf41f8d0268dcb301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
}