Forum

> > CS2D > Scripts > Knockback turrets problme
Forums overviewCS2D overview Scripts overviewLog in to reply

English Knockback turrets problme

4 replies
To the start Previous 1 Next To the start

old Re: Knockback turrets problme

Masea
Super User Off Offline

Quote
If you mean, you don't want to turrets be able to knock the players back, then here you go:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("hit","knock_hit")
function knock_hit(id,source,wpn,hpdmg,apdmg,rawdmg,objid)
	if objid then return 0 end

	if knockpoint[source]>0 then -- CHECKING IF SOURCE PLAYER'S WEAPON IS BULLET-GUN
		if player(id,"team")~=player(source,"team") then -- CHECKING SOURCE'S TEAM
			kp=knockpoint[source]
			local distance = 1
			if distance then
				local rot = math.rad(player(source,'rot')-180)
				local xe, ye = -math.sin(rot)*distance*kp, math.cos(rot)*distance*kp
				xt = player(id,"x")+xe
				yt = player(id,"y")+ye
				parse ("setpos "..id.." "..xt.." "..yt)
			end
		end
	end
end
Change the "hit" hook with this one, and it'd work as how you want.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview