Forum

> > CS2D > Scripts > Knockback turrets problme
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Knockback turrets problme

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Knockback turrets problme

Masea
Super User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht