Forum

> > CS2D > Scripts > Why doesn't it work?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Why doesn't it work?

47 replies
Page
To the start Previous 1 2 3 Next To the start

old Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Quote
Replace
1
2
3
4
5
6
7
8
9
addhook("startround","_startround")
function _startround(mode)
     for k,v in pairs (player(0,"tableliving")) do
          if Milk[v] == nil then
               Milk[v] = image("gfx/7hud/full.png",555,300,2)
               imagealpha(Milk[v],0.5)
          end
     end
end
with
1
2
3
4
5
6
7
addhook("spawn","_spawn")
function _spawn(id)
     if Milk[id] == nil then
          Milk[id] = image("gfx/7hud/full.png",555,300,2)
          imagealpha(Milk[id],0.5)
     end
end

old Re: Why doesn't it work?

Mami Tomoe
User Off Offline

Quote
@user Rainoth: Thanks, yours such a good script-er

Edit: Hi, the image duplicates itself on the screen every time you die, can you make it disappear on death?
edited 1×, last 21.09.15 10:19:34 pm

old Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
addhook("die","_die")
function _die(victim,killer,weapon)
	  if Milk[victim] ~= nil then
               freeimage(Milk[victim])
               Milk[victim] = nil
          end
end

old Re: Why doesn't it work?

Mami Tomoe
User Off Offline

Quote
1 Last thing =D when peoples spawn it duplicate the image, that's mean 32 players = 32 images on the same position

old Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
addhook("spawn","_spawn")
function _spawn(id)
     if Milk[id] == nil then
          Milk[id] = image("gfx/7hud/full.png",555,300,2,id)
          imagealpha(Milk[id],0.5)
     end
end

old Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Quote
There's a limit you know. Next time say properly what you want so we wouldn't (I wouldn't) have to make 15 replies before you're content.
1
2
3
4
5
6
7
addhook("die","abc")
function abc(v,k,w)
	if Milk[v] then
		freeimage(Milk[v])
		Milk[v] = nil
	end
end
To the start Previous 1 2 3 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview