Forum

> > CS2D > Scripts > my zombie plague error/i don't understand
Forums overviewCS2D overview Scripts overviewLog in to reply

English my zombie plague error/i don't understand

2 replies
To the start Previous 1 Next To the start

old my zombie plague error/i don't understand

D-senpai
User Off Offline

Quote
hi us nreal software users!
today i want to add something on my own zp script.
like if survivor hit gut bomb and be zombie like on zombie plague by simonas (Blazzingxx).
this script are based on cs2d lua sample(because i'm just a n**b).
the problem is i dont understand why its doesn't working.
1
parse("customkill "..id.." Infected "..suspect)

and if you want to help me more for this script pm me .

the last, thanks for read this thread and helping too
Maybe my english is bad. i'm sorry for that
Code ^_^ >

old Re: my zombie plague error/i don't understand

GeoB99
Moderator Off Offline

Quote
Looking at the code it should work as expected but I guess it doesn't display who infected the player, no? If so, you have set up the variables wrong in the cs2d cmd customkill parameters. I assume by "suspect" you're referring to the killer (zombie) which infects the victim (id), right? They need to be inverted.

Besides, another main point to consider is the team condition check. We have to be entirely sure that the killer is a zombie and not something else within cs2d lua hook hit hook. Here I've tweaked the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("hit", "flash_hit")

function flash_hit(id, Suspect, weapon)
     if ( weapon == 86 ) then
          if ( player(Suspect, "team") == 1 ) then
               if ( player(id, "team") == 2 ) then

                    hit86_id_x = player(id, "x")
                    hit86_id_y = player(id, "y")
                    parse("customkill " .. Suspect .. " Infected " .. id)
                    parse("maket " .. id)
                    parse("setpos " .. id .. " " .. hit86_id_x .. " " .. hit86_id_y)
               end
          end
     end
end

old Re: my zombie plague error/i don't understand

D-senpai
User Off Offline

Quote
Thanks for your help now it's working

but it's still have problem.the problem is setpos. after human has been infected by zombie they die (same as before). i hope it's can be like simonas zombie plague. whats wrong again?? no error log on console.

Sorry it has been fixed.i understand now.

Thanks anyway
edited 1×, last 04.09.16 04:14:29 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview