English infection

5 replies
Goto Page
To the start Previous 1 Next To the start
03.02.19 07:18:40 pm
Up
DefuseKIT
User
Offline Off
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
03.02.19 09:36:44 pm
Up
Mxcd2345
COMMUNITY BANNED
Offline Off
@user DefuseKIT:

Code:
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?
03.02.19 11:19:07 pm
Up
G3tWr3ck3d
User
Offline Off
Code:
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
Mess with the best, die like the rest. ༼ つ ◕_◕ ༽つ
08.02.19 04:35:02 pm
Up
DefuseKIT
User
Offline Off
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
08.02.19 06:05:03 pm
Up
G3tWr3ck3d
User
Offline Off
Code:
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
Mess with the best, die like the rest. ༼ つ ◕_◕ ༽つ
08.02.19 06:12:53 pm
Up
DefuseKIT
User
Offline Off
user G3tWr3ck3d has written:
Code:
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