Forum

> > CS2D > Scripts > Image when joining
Forums overviewCS2D overview Scripts overviewLog in to reply

English Image when joining

8 replies
To the start Previous 1 Next To the start

old Image when joining

KoJKa
BANNED Off Offline

Quote
Why when I join my server with second cs2d, image is not shown?

1
2
3
4
5
6
plr_image = {}

addhook("join","image_j")
function image_j(id)
	plr_image[id] = image("gfx/blood.bmp",0,0,2,id)
end

old Re: Image when joining

Gripex
User Off Offline

Quote
user KoJKa has written
Why when I join my server with second cs2d, image is not shown?

1
2
3
4
5
6
plr_image = {}

addhook("join","image_j")
function image_j(id)
	plr_image[id] = image("gfx/blood.bmp",0,0,2,id)
end


There is no mistake here you gave x and y 0 so you may not see the pic try and as @user Cure Pikachu: said check out the image path.

old Re: Image when joining

Scott
BANNED Off Offline

Quote
something like that?

1
2
3
4
5
6
7
8
9
addhook("join","image_j")
function image_j()
     HUDImage = image('gfx/blood.bmp', 320, 170, 2)
     timer(1000, "hideHUDImage", nil, 1)
end

function hideHUDImage()
    tween_alpha(HUDImage, 1000, 0) -- 0: invisible @ 1: visible
end

old Re: Image when joining

KoJKa
BANNED Off Offline

Quote
On first cs2d(where server launched), I see the image, but when i joined on server from second cs2d, I don't see the image.
I think it`s problem in hook, no?
I can fix it if create timer.

old Re: Image when joining

Cure Pikachu
User Off Offline

Quote
@user KoJKa: And here I told you to check if said image exists on the client. And if it doesn't, read this:
cs2d lua cmd image has written
Attention: Missing images are not always transferred over the internet and you can never be sure that all clients/players actually accept and see all those images! Use the file sys/servertransfer.lst to add custom images to the transfer list (this still doesn't ensure that everyone will receive those images but it will work in most cases)

That means you add this line to your server's *CS2D root*\sys\servertransfer.lst file:
gfx/blood.bmp

old Re: Image when joining

Gaios
Reviewer Off Offline

Quote
user Gaios has written
You can't show images at dedicated server via cs2d lua hook join. You can use cs2d lua hook team instead or kill user DC.

Can you even read my post guys?! I'm old user here and this is the problem!

old Re: Image when joining

Masea
Super User Off Offline

Quote
Pretty much what user Gaios said.

Besides, if that image will not be changed and will stay throughout whole game as is for specific players, then you could simply add the image function outside of hooks. This way it'd work more correct than ever and for all players.
1
local img = image('gfx/blood.bmp', 320, 170, 2)
That's all about it. Just delete your all other images, and put it to out of hooks and see what happens.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview