Forum

> > CS2D > Scripts > Why doesn't it work?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Why doesn't it work?

47 Antworten
Seite
Zum Anfang Vorherige 1 2 3 Nächste Zum Anfang

alt Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Zitieren
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

alt Re: Why doesn't it work?

Mami Tomoe
User Off Offline

Zitieren
@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?
1× editiert, zuletzt 21.09.15 22:19:34

alt Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Zitieren
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

alt Re: Why doesn't it work?

Mami Tomoe
User Off Offline

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

alt Re: Why doesn't it work?

Rainoth
Moderator Off Offline

Zitieren
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

alt Re: Why doesn't it work?

Rainoth
Moderator Off Offline

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