1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function initArray(count)	--Makes function with parameters
	local array = {}		--Creates an empty array that cant be used outside of this function
	for i = 0, count do		--Loops as many times as parameter tells it to
		array[i]=0 			--Creates an element in the array with value 0
	end 					--Ends loop
	return array 			--returns the newly made array to whatever called it
end 						--ends function
teams=initArray(32)			--should contain teams of all player ids, your menu should set it with teams[id]=*Gangname here*
addhook("hit","TeamDamageCheck")			--Makes the function execute whenever someone is hit
function TeamDamageCheck(id,source) 		--function
	if ( teams[id] == teams[source] ) then 	--checks if attackers team is same as victms
		return 1 							--if last statement was true, ignores the hit
	end 				--ends statement
end 					--ends function