Forum

> > CS2D > Scripts > Spawn Image
Forums overviewCS2D overview Scripts overviewLog in to reply

English Spawn Image

22 replies
Page
To the start Previous 1 2 Next To the start

old Spawn Image

Bobakrome
User Off Offline

Quote
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

old Re: Spawn Image

Big Bang Mafia
User Off Offline

Quote
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
edited 1×, last 26.12.11 07:04:59 pm

old Re: Spawn Image

Jynxxx
User Off Offline

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

old Re: Spawn Image

Jynxxx
User Off Offline

Quote
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

old Re: Spawn Image

Bobakrome
User Off Offline

Quote
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

old Re: Spawn Image

Yates
Reviewer Off Offline

Quote
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

old Re: Spawn Image

Yates
Reviewer Off Offline

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

old Re: Spawn Image

Bobakrome
User Off Offline

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

Edit ---
And yes the images exist ??
edited 1×, last 26.12.11 09:13:12 pm

old Re: Spawn Image

MikuAuahDark
User Off Offline

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

old Re: Spawn Image

Bobakrome
User Off Offline

Quote
user Bobakrome has written
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

old Re: Spawn Image

MikuAuahDark
User Off Offline

Quote
@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

old Re: Spawn Image

Bobakrome
User Off Offline

Quote
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
edited 1×, last 27.12.11 02:56:12 pm

old Re: Spawn Image

EP
User Off Offline

Quote
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

old Re: Spawn Image

MikuAuahDark
User Off Offline

Quote
@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()
?

old Re: Spawn Image

mafia_man
User Off Offline

Quote
Image on player need to be initialized when player is alive not when dead. So Join/Start Round hooks will not work.
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview