Sign in to follow this  
darkie

welcome message loop

Recommended Posts

I got this welcome message from forum and was using it in my server.
Unfortunately i found that this is being called everytime a player joins the server and it displays over and over again on every player screen multiple times instead of showing it just once.

Unlike the tutorial here the welcome message only shows up once the player has joined instead of showing up each time a player joins in.

welcome.gsc

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

First of all your Hud Elements are global, that's why every player can see them.

And about your second point with the tutorial i am not sure if i get you right.

Your Code is executed whenever a player connects, no matter if it's a real connectipm or just a restarting round of snd.

To avoid that add a check if the player score is already defined.

 

Edit: give this one a try. I made the changes from phone so i hope I have no bad syntax.

 

welcome.gsc

Edited by Viking

Share this post


Link to post
Share on other sites

Called it from "_callbacksetup.gsx"  - thread code\welcome::main();

Does not seems to be working anymore.

Share this post


Link to post
Share on other sites

What if you change the

thread showmessage

to

self thread showmessage

Share this post


Link to post
Share on other sites
Posted (edited)
21 hours ago, Viking said:

What if you change the

thread showmessage

to

self thread showmessage

self thread message();  -- > self thread showmessage();   //changed the following in line 96

Still nothing happens.

Edited by darkie

Share this post


Link to post
Share on other sites

Not line 96.

Line 105, 107 and so on.

 

I am not around a PC until Monday, but i'll give it a go when i am back home.

Share this post


Link to post
Share on other sites
1 hour ago, Viking said:

Not line 96.

Line 105, 107 and so on.

 

I am not around a PC until Monday, but i'll give it a go when i am back home.

Oh! Alright, i will do that and inform you :)

Share this post


Link to post
Share on other sites

I assume this is there so it doesnt happen again on round changes.

if(!isdefined(peep.pers["score"]))

 

Just a thought but remove the check and add

level endon("game_ended")

to the onSpawnedPlayer thread to kill it at the end of the first round so it wont restart.  Something to try out to see what happens. Also, add logprint statements at appropriate places to track things and make sure the correct functions are called, or not called as the case may be, and variables are set correctly. "Intermission" should do it also anyways but cant hurt to try.

Share this post


Link to post
Share on other sites
17 hours ago, Viking said:

This seems to working fine but there is one problem. It shows up each and everytime a new map starts. Is it not possible to show it only once as long as the player is in-game and when he rejoins it will show up again.?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this