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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
spawnprotection = initArray(32)
spawninvincible = initArray(32)
spawnnotice = initArray(32)
print("loading ...")
addhook("spawn","ej_spawn_p")	 -- Set / Gives Spawn Protection
addhook("ms100","ej_spawn_p_set") -- Spawn Protection
addhook("second","ej_spawn_p_time") -- Spawn Protection Timer
addhook("hit","ej_spawn_p_dmg") -- Can't Get Dmg with Spawn Protection On ( Fixed Lazers )
addhook("hit","ej_spawn_p_atk")	 -- Spawn Protection Notices
function ej_spawn_p(id)
spawnprotection[id] = 15
	if (spawnprotection[id] > 0) then
		msg2(id,"©000255000You have Spawn Protection.@C")
		local i = image('gfx/serverlove.foromx.net/1212132.png', 1, 1, 100+id)
tween_alpha(i, 17000, 0)
		spawninvincible[id] = 1
	end
end
function ej_spawn_p_set()
	for p = 1,32 do
		if (spawninvincible[p] == 1) then
parse("setmaxhealth "..p.." 250")
			parse("sethealth "..p.." 250")
			if (spawnprotection[p] == 0) or (spawnprotection[p] <= 0) then
				msg2(p,"©255000000Your Spawn Protection is now off.@C")
				spawninvincible[p] = 0
parse("setmaxhealth "..p.." 100")
parse("sethealth "..p.." 100")
			end
		end
	end
end
function ej_spawn_p_dmg(id,source)
	if (spawninvincible[id] == 1) or (spawninvincible[source] == 1) then
		return 1
else
	return 0
	end
end
	
function ej_spawn_p_time()
	for p = 1,32 do
		if (spawninvincible[p] == 1) then
			spawnprotection[p] = spawnprotection[p] - 1
		end
	end
end
function ej_spawn_p_atk(id,source)
	if ( spawnnotice[source] == 1 ) then
		if ( spawninvincible[id] == 1 ) then
			msg2(source,"©235235235"..player(id,"name").." has Spawn Protection for "..spawnprotection[id].." seconds.")
		end
	end
end