Forum

> > CS2D > Scripts > Join hook does not work!
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Join hook does not work!

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Join hook does not work!

Masea
Super User Off Offline

Zitieren
Hello everybody, in this thread I'm going to tell you a problem.

1
2
3
4
5
6
7
8
addhook("join","dead_join")
function dead_join(id)
	parse('hudtxt 5 "©255255255'..generator..'" 20 391 1')
	parse('hudtxt 1 "©255255255'..s1..'" 35 460 1')
	parse('hudtxt 2 "©255255255'..s2..'" 95 460 1')
	parse('hudtxt 3 "©255255255'..s3..'" 155 460 1')
	parse('hudtxt 4 "©255255255'..s4..'" 215 460 1')
end

I was trying to do some scripts in nowadays and I met this; I opened 2 cs2d for test, everything is ok on first cs2d but on the second cs2d, It wasn't working. I couldn't see texts.

And here is a image, it may tell you more about problem:


Thanks, hope somebody will help me.

alt Re: Join hook does not work!

Masea
Super User Off Offline

Zitieren
user Mami Tomoe hat geschrieben
Are there any errors?
Yes? Show us.
No? Make sure the .LUA file is not in the autorun folder or server.LUA file and try again.


Thanks. There isn't any error and I did what you said me, didn't work.

But I solved the problem with these codes;
Spoiler >

alt Re: Join hook does not work!

Yates
Reviewer Off Offline

Zitieren
Join is triggered when someone tries to connect to the server. You can see them in the spectators but they might still be connecting and then the game is not initialized yet. Because of this it is recommended to NOT do anything important or visual on join, instead either solve this the ugly way by doing what you've done and use a timer or do things the first time they join a team, this way you know everything is done and loaded on their side.

Note that using a timer may still not work, especially when someone has a slow network and is downloading a load of files.

alt Re: Join hook does not work!

Masea
Super User Off Offline

Zitieren
By then, user DC needs to change that how "join" hook does work. Should be like hook come into play when player who trying to connect server, completed all files or join attempts.

Anyways, thank you all.

alt Re: Join hook does not work!

Yates
Reviewer Off Offline

Zitieren
Well the join hook is also handy the way it is. The only thing I would change would be an extra parameter which would tell us if it is a connection join or if it is a completed join.

alt Re: Join hook does not work!

BcY
Reviewer Off Offline

Zitieren
user Yates hat geschrieben
Well the join hook is also handy the way it is. The only thing I would change would be an extra parameter which would tell us if it is a connection join or if it is a completed join.


Would be great.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht