Forum

> > CS2D > Scripts > Spawn Image
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Spawn Image

22 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Spawn Image

Bobakrome
User Off Offline

Zitieren
Hi there , All i want is edit this script , i want the image to rotate same time with player , and be on the player not under! Like its under the player and it cant rotate if me rotate

Edit

This is what i made :

1
2
3
4
5
6
7
8
9
10
11
12
if sample==nil then sample={} end
sample.santahat={}
function sample.santahat.everyonesanta()
	for i=1,32,1 do
		id=image("gfx/cp/53.bmp",1,0,100+i)
	end
end
sample.santahat.everyonesanta()
addhook("startround","sample.santahat.startround")
function sample.santahat.startround()
	sample.santahat.everyonesanta()
end

alt Re: Spawn Image

Big Bang Mafia
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("spawn" , "santa")
function santa(id)
freeimage(id)
            id=image("gfx/cp/53.bmp",1,0,100+id)

end

i did not test it you can test it
1× editiert, zuletzt 26.12.11 19:04:59

alt Re: Spawn Image

Jynxxx
User Off Offline

Zitieren
well i made a say command instead of Big Bang Mafia but any way will work. Depending on how you want it.
Spoiler >
1× editiert, zuletzt 26.12.11 19:07:09

alt Re: Spawn Image

Jynxxx
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
_YOUR_USGN_ = 29595
addhook("startround","adminimage")
function adminimage()
	for index,id in ipairs(player(0,"table")) do
		if player(id,"usgn") == _YOUR_USGN_ then
		local img=image("gfx/cp/53.bmp",0,0,100+id)
		imagecolor(img,255,255,0)
		imageblend(img,1)
		imagealpha(img,0.5)
		end
	end
end

addhook("die","remove")
function remove()
	freeimage(id)
end

alt Re: Spawn Image

Bobakrome
User Off Offline

Zitieren
But everyone to have , i mean CTs have :
1
gfx/sprulez/ctsanta.bmp
and Ts have
1
gfx/sprulez/tsanta.bmp
When they spawn...
AND EVERYONE TO HAVE

alt Re: Spawn Image

Yates
Reviewer Off Offline

Zitieren
1
2
3
4
5
6
7
8
addhook("spawn","hats")
function hats(id)
	if player(id,"team")==1 then
		id=image("gfx/sprulez/tsanta.bmp",1,0,100+id)
	elseif player(id,"team")==2 then
		id=image("gfx/sprulez/ctsanta.bmp",1,0,100+id)
	end
end

alt Re: Spawn Image

Yates
Reviewer Off Offline

Zitieren
Does the image exist? Check the console, maybe there are errors.

alt Re: Spawn Image

Bobakrome
User Off Offline

Zitieren
Nothing not right in the console?
1
Lua adding : function 'hats' to hook 'spawn'

Edit ---
And yes the images exist ??
1× editiert, zuletzt 26.12.11 21:13:12

alt Re: Spawn Image

MikuAuahDark
User Off Offline

Zitieren
hmm. everything right!
maybe this is works!:
Spoiler >

alt Re: Spawn Image

Bobakrome
User Off Offline

Zitieren
user Bobakrome hat geschrieben
But everyone to have , i mean CTs have :
1
gfx/sprulez/ctsanta.bmp
and Ts have
1
gfx/sprulez/tsanta.bmp
When they spawn...
AND EVERYONE TO HAVE


I need as ct to have
1
gfx/sprulez/ctsanta.bmp
and t have
1
gfx/sprulez/tsanta.bmp

alt Re: Spawn Image

MikuAuahDark
User Off Offline

Zitieren
@user Bobakrome: hmm ok!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function everyonesanta()
for i = 1,32,1 do
if player(i,"team")==2 then idct=image("gfx/sprulez/ctsanta.bmp",1,1,200+i)
elseif player(i,"team")==1 then idt=image("gfx/sprulez/tsanta.bmp",1,1,200+i) end
end
end

everyonesanta()

addhook("startround","santahatstartround")
function santahatstartround()
everyonesanta()
end

-- maybe you must start it manually(maybe works)
-- insert this command below(without --) to work it manually!
-- lua everyonesanta()
-- maybe it's bugged

alt Re: Spawn Image

Bobakrome
User Off Offline

Zitieren
Didn't worked
IMG:https://img526.imageshack.us/img526/2301/devade.jpg

these are the files
IMG:https://img3.imageshack.us/img3/7619/75266810.jpg
1× editiert, zuletzt 27.12.11 14:56:12

alt Re: Spawn Image

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function asd(id)
if team==1 then 
freeimage(id)
rimg=image("gfx/SPRulez/tsanta.bmp",1,1,id+100)
elseif team==2 then
freeimage(id)
bimg=image("gfx/SPRulez/ctsanta.bmp",1,1,id+100)
end
end

addhook("team","a")
function a(id,team)
asd(id)
end
UNTESTED

alt Re: Spawn Image

MikuAuahDark
User Off Offline

Zitieren
@user Bobakrome: im just sorry, because me not smart in image!
EDIT: oh yeah, did you:
1. see the console?
2. start it manually with command
1
lua everyonesanta()
?

alt Re: Spawn Image

mafia_man
User Off Offline

Zitieren
Image on player need to be initialized when player is alive not when dead. So Join/Start Round hooks will not work.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht