edited 1×, last 07.04.15 04:06:37 pm
Admin/mod comment
§2.2 - Only meaningful contributions with added value
-Del-
-Del-
1

§2.2 - Only meaningful contributions with added value if lua==nil then lua={} end
lua.ghost = {} -- Fixed
---------------------
----Spawn Script----
---------------------
addhook("spawn","lua.ghost.spawn")
function lua.ghost.spawn(id)
	if player(id,"team")==1 then
		-- Ghost Health (200)
		parse ("setmaxhealth "..id.." 200")
		-- Invisiblity
		parse("setarmor "..id.." 206")
	elseif player(id,"team")==2 then
		-- Humans Health (100)
		parse ("setmaxhealth "..id.." 100")
	end
end
------------------------
----Countdown Script----
------------------------
rtcdown=0
function lua.ghost.randplayer()
	local rndpl=player(0,"team2")[math.random(1,#player(0,"team2"))]
	parse("maket "..rndpl)
	return rndpl
end
function lua.ghost.countdown()
	rtcdown=10
	msg(rtcdown)
	timer(1000,"parse","lua rtcdown=rtcdown-1; lua msg(rtcdown)",10)
	timer(10000,"parse","lua \"msg(player(randplayer(),'name')..' is the ghost!')\"")
end
addhook("startround","lua.ghost.checkfort")
function lua.ghost.checkfort()
	if #player(0,"team1")==0 then
		countdown()
	end
end
addhook("endround","lua.ghost.makeallct")
function lua.ghost.makeallct()
	for _, i in pairs(player(0,"team1")) do
		parse("makect "..i)
	end
end
------------------
----Server Hud----
------------------
addhook("join","lua.ghost.join")
function lua.ghost.join() -- Fixed
	parse('hudtxt 1 "...CSO Ghost Mode Server" 320 260 1')
end
-------------------
----Ghost.Sound----
-------------------
addhook("kill","lua.ghost.kills")
function lua.ghost.kills(killer,victim,weapon)
	if player(killer,"team")==1 then
		-- Sound File (zm_spray)
		parse("sv_sound \"player/zm_spray.wav\"")
	end
end
1
