English Image when joining

8 replies
Goto Page
To the start Previous 1 Next To the start
24.02.17 08:08:48 pm
Up
KoJKa
BANNED
Offline Off
Why when I join my server with second cs2d, image is not shown?

Code:
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
24.02.17 08:58:45 pm
Up
Cure Pikachu
User
Offline Off
Check the *CS2D root*\gfx folder. Does it have the blood.bmp file? I am talking about your "second CS2D".
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
24.02.17 09:23:46 pm
Up
Gaios
Security Supporter
Offline Off
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.
24.02.17 09:24:32 pm
Up
Gripex
User
Offline Off
user KoJKa has written:
Why when I join my server with second cs2d, image is not shown?

Code:
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.
24.02.17 09:28:07 pm
Up
Scott
BANNED
Offline Off
something like that?

Code:
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
25.02.17 12:36:05 am
Up
KoJKa
BANNED
Offline Off
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.
25.02.17 02:02:00 am
Up
Cure Pikachu
User
Offline Off
@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
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
25.02.17 10:24:27 am
Up
Gaios
Security Supporter
Offline Off
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!
25.02.17 10:33:22 am
Up
Masea
Super User
Offline Off
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.
Code:
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.
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (28)
To the start Previous 1 Next To the start