Forum

> > CS2D > Scripts > Script Bug
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script Bug

4 replies
To the start Previous 1 Next To the start

old Script Bug

francis007
BANNED Off Offline

Quote
Hey everyone! I have a bug on my nemesis script.

What the script should do: If the nemesis left the server and if there are still zombies in the server then a other zombie will be the new nemesis and not a CT. I hope someone can fix it. Thanks!

Bug: sometimes the nemesis doesn't spawn and the nemesis countdown doesn't work.

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
35
36
37
38
39
40
41
42
43
function zp_leave(p)
     zp_player_reset(p)
     if (zp_nemesis_id == p) then
               --- Make Zombie a Nemesis
               local zteam = player(0,"team1")
               local zombienemesis = false
               for i = 1, #zteam do -- I know its unfair and has no random
                    if player(i, "bot") == false then
                         -- make this player a nemesis
                               zp_nemesis_id = i
                         zp_p_class[i] = -1
                               
                               local x, y = player(i, "x"), player(i, "y")
                         parse("killplayer ".. i)
                               parse('spawnplayer '..i..' '..x..' '..y)
                         
                         if hatid[i] then
                              freeimage(hatid[i])
                         end
                         hatid[i]=image("gfx/zombieplague/zombieboss.png",2,1,200+i)
                         zp_snd(math.random(9,10))
                         
                         zp_msg(4, "Zombie Boss disappeared... But it's known that there's another one lurking!")
                         
                         zombienemesis = true
                         break
                    end
               end
               
               ---
               -- only reset these values if we didn't find a new zombie nemesis
               if not zombienemesis then
                 zp_nemesis_id = 0
                 zp_on_tip = 0
                 zp_nemesis_sec = 30
                 zp_msg(4,'Zombie Boss Left The Server - New Zombie boss will be selected in '..zp_nemesis_sec..' seconds!')
               end
          nemesis_cnt[p] = 0
          zp_p_class[p] = zp_p_last_class[p]
          freeimage(hatid[p])
          
     end
end
edited 3×, last 16.12.16 07:02:04 pm

old Re: Script Bug

-Last-
BANNED Off Offline

Quote
1
2
3
local x = player(i, "tilex")
	local y = player(i, "tiley")
	parse("spawnplayer "..i.." "..x.." "..y)

i think, you need spawn player with tile map.

old Re: Script Bug

VADemon
User Off Offline

Quote
Under what circumstances the nemesis doesn't respawn, which of both messages is shown? You are not providing enough information.

old Re: Script Bug

francis007
BANNED Off Offline

Quote
I was thinking about it and i have an other idea. I want if nemesis left the server and if there are still zombies in the server then none will be the nemesis. Is it easier?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview