Forum

> > CS2D > Scripts > Join hook does not work!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Join hook does not work!

7 replies
To the start Previous 1 Next To the start

old Join hook does not work!

Masea
Super User Off Offline

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

old Re: Join hook does not work!

Mami Tomoe
User Off Offline

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

old Re: Join hook does not work!

Masea
Super User Off Offline

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

old Re: Join hook does not work!

BcY
Reviewer Off Offline

Quote
Join hooks is also bugged. I had the same problem before.Also sometimes it doesnt read the id.

old Re: Join hook does not work!

Yates
Reviewer Off Offline

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

old Re: Join hook does not work!

Masea
Super User Off Offline

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

old Re: Join hook does not work!

Yates
Reviewer Off Offline

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

old Re: Join hook does not work!

BcY
Reviewer Off Offline

Quote
user Yates has written
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview