Forum

> > CS2D > Scripts > infection
Forums overviewCS2D overview Scripts overviewLog in to reply

English infection

5 replies
To the start Previous 1 Next To the start

old infection

DefuseKIT
User Off Offline

Quote
addhook("hit","hit1")
function hit1(id,s,wpn)
x = player(id,[[x]])
y = player(id,[[y]])
if wpn==86 then
if player(s,[[team]])==1 then
if player(id,[[team]])==2 then
parse("customkill "..s.." Infected "..id)
al[id]=1
parse([[maket ]]..id)
parse("spawnplayer "..id.." "..x.." "..y)
parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav")
parse("sv_sound2 "..s.." !ALFA!SOUND/human_pain1.wav")
al[id]=0
aps[s]=aps[s]+1
end
end
end
if wpn==78 then
if player(s,[[team]])==1 then
if player(id,[[team]])==2 then
parse("customkill "..s.." Infected "..id)
al[id]=1
parse([[maket ]]..id)
parse("spawnplayer "..id.." "..x.." "..y)
aps[s]=aps[s]+1
parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav")
parse("sv_sound2 "..s.." !ALFA!SOUND/human_pain1.wav")
al[id]=0
end
end
end
end

this script is fo my zombie server, but it appears that zm kills Humans instantly with one hit instead of converting them into same with gutbomb, but instead of gutbomb and claws it writes "Infected" as wpn name, pls help me

old Re: infection

Mxcd2345
COMMUNITY BANNED Off Offline

Quote
@user DefuseKIT:

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
pos = {}

addhook("hit","hit1")
function hit1(id,s,wpn)
  if wpn == 86 then
    if player(s,"team") == 1 and player(id,"team") == 2 then 
      parse("customkill "..s.." Infected "..id)
        al[id] = 1
          parse("maket "..id)
            parse("spawnplayer "..id.." "..pos[id].x.." "..pos[id].y)
            parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav") 
          parse("sv_sound2 "..s.." !ALFA!SOUND/human_pain1.wav") 
        al[id] = 0
      aps[s] = aps[s]+ 1	
   end
end
  if wpn==78 then
    if player(s,"team") == 1 and player(id,"team") == 2 then 
      parse("customkill "..s.." Infected "..id)
        al[id] = 1
          parse("maket "..id)
            parse("spawnplayer "..id.." "..pos[id].x.." "..pos[id].y)
            aps[s] = aps[s]+ 1
          parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav") 
        parse("sv_sound2 "..s.." !ALFA!SOUND/human_pain1.wav") 
      al[id] = 0
    end
  end
end 

addhook("die","_die")
function _die(id,k,w,x,y)
  pos[id] = {x = x, y = y}
end

Is this what you need?

old Re: infection

G3tWr3ck3d
User Off Offline

Quote
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
addhook("hit","hit1")
function hit1(id,s,wpn)
	if wpn == 86 or wpn == 78 then
		infected(id,s)
	end
end

function infected(id,source)
	local x = player(id,[[x]])
	local y = player(id,[[y]])
	local terrorists = player(source,[[team]]) == 1
	local counter_terrorists = player(id,[[team]]) == 2
	if terrorists then 
		if counter_terrorists then
			al[id] = 1
			parse([[maket ]]..id)
			parse("spawnplayer "..id.." "..x.." "..y)
			parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav") 
			parse("sv_sound2 "..source.." !ALFA!SOUND/human_pain1.wav") 
			al[id] = 0
			aps[source]=aps[source]+1
		end
	end
end

--	parse("customkill "..source.." Infected "..id) -- Removed your "Infected" customkill

optimized
edited 1×, last 04.02.19 08:43:28 am

old Re: infection

DefuseKIT
User Off Offline

Quote
No, I want to keep claw with its name "Infected".
The problem is in script, it KILLS Human instead of INFECTING THEM. IT KILLS THEM instead of Infecting
I want Infection function for Zombies with Claw/Gutbombs just like in Blazzingx's Zombie Plague lua

old Re: infection

G3tWr3ck3d
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("hit","hit1")
function hit1(id,source,wpn)
	if player(source,"team") == 1 then -- Terrorists [Attacker]
		if wpn == 86 or wpn == 78 then -- If weapon Gut Bomb or Claw
--			al[id] = 1 -- ??
			parse("maket "..id)
			parse("customkill "..source.." Infected "..id)
			parse("spawnplayer "..id.." "..player(id,"x").." "..player(id,"y"))
			parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav") 
			parse("sv_sound2 "..source.." !ALFA!SOUND/human_pain1.wav") 
--			al[id] = 0 -- ??
			aps[source] = aps[source]+1
		end
	end
end

This should work if it doesnt then show the full script

old Re: infection

DefuseKIT
User Off Offline

Quote
user G3tWr3ck3d has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("hit","hit1")
function hit1(id,source,wpn)
	if player(source,"team") == 1 then -- Terrorists [Attacker]
		if wpn == 86 or wpn == 78 then -- If weapon Gut Bomb or Claw
--			al[id] = 1 -- ??
			parse("maket "..id)
			parse("customkill "..source.." Infected "..id)
			parse("spawnplayer "..id.." "..player(id,"x").." "..player(id,"y"))
			parse("sv_sound2 "..id.." !ALFA!SOUND/human_pain1.wav") 
			parse("sv_sound2 "..source.." !ALFA!SOUND/human_pain1.wav") 
--			al[id] = 0 -- ??
			aps[source] = aps[source]+1
		end
	end
end

This should work if it doesnt then show the full script
Doesnt work
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview