Raised This Month: $ Target: $400
 0% 

Name on reconnect problems...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n04d
Junior Member
Join Date: Jan 2005
Old 02-05-2005 , 17:17   Name on reconnect problems...
Reply With Quote #1

Alright, I'm working on a system that when somebody joins it adds them to a playerlist I'm drawing with set/show_hudmessage. When they join, etc. it works fine and when they leave it removes their name from the list. But if they are like, reconnecting or something to the server, they don't appear back on the list.

Any ideas?
n04d is offline
n04d
Junior Member
Join Date: Jan 2005
Old 02-06-2005 , 11:29  
Reply With Quote #2

I am using the replace and format funtion to find their names on the list once they join a different team, and it removes them from the team they were on and adds them to the other team. Not sure if that's a problem though, and it's keeping it from drawing their name the next time they get on.
n04d is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-06-2005 , 12:50  
Reply With Quote #3

client_connect is called when they first join the server. client_disconnect is called when they leave the server. client_putinserver is called when the game registers them as in the game and puts their name on the spectator part of the scoreboard. If a user types "retry" in console, I do not believe that connect or disconnect will be called, only putinserver.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
n04d
Junior Member
Join Date: Jan 2005
Old 02-06-2005 , 16:41  
Reply With Quote #4

I'm calling everything from putinserver, but I still have the problem...
n04d is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-06-2005 , 17:52  
Reply With Quote #5

can we see the code?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
n04d
Junior Member
Join Date: Jan 2005
Old 02-09-2005 , 17:46  
Reply With Quote #6

Yeah, here is where I call the function to add the person to the "Not Ready!" list...

Code:
public client_putinserver(id) 
{	
	playerlistNotReady(id)
}
Now, it add's them fine...with this code.

Code:
public playerlistNotReady(id)
{
	get_user_name(id,playername,31)
	if (equal(notready,"None!"))
		format(notready,31,"%s",playername)
	else {
		format(list1,31,"^n%s",playername)
		add(notready,255,list)
	}
	return 1
}
And if they leave the server, they get removed with this code...(Also removes them if they are ready, but either ready or not, it still doesn't work...)

Code:
public playerListRemove(id)
{
	get_user_name(id,playername,31)

	format(list,39,"%s",playername)
		replace(notready,255,list,"None!")

	format(list,39,"^n%s",playername)
		replace(notready,255,list,"")

	format(list,39,"%s^n",playername)
		replace(notready,255,list,"")
}
Which I also use the same removal code for the person if they leave while they are on the "Ready!" list...

I call that whenever they leave the server, so in...

Code:
public client_disconnect(id)
{
	playerListRemove(id)
}
n04d is offline
n04d
Junior Member
Join Date: Jan 2005
Old 02-10-2005 , 17:48  
Reply With Quote #7

Any ideas?
n04d is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-10-2005 , 22:41  
Reply With Quote #8

Code:
public playerlistNotReady(id) {    get_user_name(id,playername,31)    if (equal(notready,"None!"))       // HERE YOU FORMAT IT AS 31?       format(notready,31,"%s",playername)    else {       format(list1,31,"^n%s",playername)       // HERE YOU ADD IT AS 255?       add(notready,255,list)    }    return 1 }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
n04d
Junior Member
Join Date: Jan 2005
Old 02-14-2005 , 20:34  
Reply With Quote #9

Alright, that all works, thanks

Now one more thing, when a player connects, and they change their names, it shows their new name but their old one is just stuck there under "Not Ready" but the playerlist is refreshing...I think I have an idea how to do it, but I would like some input to see if my "theory" is right
n04d is offline
n04d
Junior Member
Join Date: Jan 2005
Old 02-15-2005 , 22:09  
Reply With Quote #10

Well, nevermind. I know how to do it.

But, I'm also working on something so names cannot be changed, but whenever I execute this on a person...

Code:
public client_infochanged(id){
	new old[32]
        new playername[32]
	get_user_info(id,"name",playername,31)
	get_user_name(id,oldname,31)
    
	client_cmd(id,"name %s",oldname)
}
To force the name back, it will keep switching between the old and the new, because they both become old whenever the other one becomes new, so it keeps forcing back and forth.
n04d is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode