Forum

> > CS2D > Scripts > image when join
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch image when join

17 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt image when join

lennon
User Off Offline

Zitieren
> I trying to make img when anybody join server, the image will disapear after x secound's, can some one help me, hard to make it...

alt Re: image when join

Rainoth
Moderator Off Offline

Zitieren
It's definitely not hard.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
img = image("gfx/747.bmp",0,1,2)
imagepos(img,240,240,0)
imagealpha(img,0)

addhook("join","yey")
function yey(id)
     tween_alpha(img,1500,1)
     freetimer("woosh")
     timer(2500,"woosh")
end

function woosh()
     tween_alpha(img,1500,0)
end

Works as following. A person joins, image appears out of nowhere, stays for a second, then disappears again. If a player joins within that time, it looks like it's appearing again.
1× editiert, zuletzt 12.07.14 22:58:29

alt Re: image when join

lennon
User Off Offline

Zitieren
not work, i check on my new game ,and on server. Everything is loading there's no error but i dont see my img. Also when i make wrong on path to img and any error like (gfx/bla/bla.png) error not such file. Do you check it ?

alt Re: image when join

Rainoth
Moderator Off Offline

Zitieren
Fine let me run it myself.
// Ok. It DID work but only after the first person joined. No idea why. I added id parameter to the hook function and now it works perfectly (tested). Why the hell do I need id argument if I'm not using it..? No idea. Well whatever.

alt Re: image when join

Rainoth
Moderator Off Offline

Zitieren
Hooks don't have parameters. They supply them if you give parameters for functions attached to them. I edited the code anyway so you can just copy paste it again and change path.

alt Re: image when join

lennon
User Off Offline

Zitieren
i know why dosnt work for me even with ID parameter. I have on my server another addhook join. First i trying to check it with my other scripts, now i tried to start it alone. Raining do u have some idea for it? And question this image shows for all, or just for each other players ?

alt Re: image when join

AlcatrazZ
BANNED Off Offline

Zitieren
By adding a hook (join) you tell the script that when a player enters the server function is called with parameters that are assigned to this hook.

example:
1. CS2D is finding hook (join).
2. CS2D found hook (join).
3. CS2D is sending parameters to function of hook.
4. SCRIPT calls the function.

function myJoin(id)
	msg2(id,"Hello, this message see only you because your id is "..id)
end
addhook("join","myJoin")

alt Re: image when join

lennon
User Off Offline

Zitieren
example:
1. I have script welcome message with addhock (join)
2. Now i add this script with image which have too addhock (join)

SO this script's do not inferfere togheter?

NEXT: about my little know, i check log's and i dont see 2x adding function x to hook "join", so i use hook fix (some lua) and restart so now i saw 2x adding function x to hook join. Now propably should to work but my reason is this script image when join dont work with any hud txt on server. Anyway THANK U Raining for U time, big beer for u from poland ! ! !
1× editiert, zuletzt 12.07.14 23:58:18

alt Re: image when join

Rainoth
Moderator Off Offline

Zitieren
@user lennon: They shouldn't interfere. It's not a say hook or something. I used to run multiple scripts running 5 different functions assigned to join. Wasn't a problem. It works for me. Maybe your image is totally black?

alt Re: image when join

lennon
User Off Offline

Zitieren
when i start only your script img without other img work fine. But when i start it with other scripts dont work. I bet that what i say, this lua cant be working with any hud lua.

Im a little sad, i making this all day, what do u think about it ? This is what u mean about tottaly black?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht