Forum

> > CS2D > Scripts > infection
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch infection

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt infection

DefuseKIT
User Off Offline

Zitieren
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

alt Re: infection

Mxcd2345
COMMUNITY BANNED Off Offline

Zitieren
@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?

alt Re: infection

G3tWr3ck3d
User Off Offline

Zitieren
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
1× editiert, zuletzt 04.02.19 08:43:28

alt Re: infection

DefuseKIT
User Off Offline

Zitieren
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

alt Re: infection

G3tWr3ck3d
User Off Offline

Zitieren
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

alt Re: infection

DefuseKIT
User Off Offline

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