Raised This Month: $ Target: $400
 0% 

How to get server name ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
expolit
New Member
Join Date: Feb 2006
Old 03-07-2006 , 03:38   How to get server name ?
Reply With Quote #1

How to get server name ?
Could you show some example of code ?
//Sorry for my bad english...
expolit is offline
Send a message via ICQ to expolit
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-07-2006 , 06:28  
Reply With Quote #2

Code:
new HostName[32] get_cvar_string("hostname" , HostName, 31)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 03-07-2006 , 14:19  
Reply With Quote #3

Would get_user_name with an index of 0 also work?
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-07-2006 , 15:47  
Reply With Quote #4

No. That uses a different system of retrieving names.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-07-2006 , 15:58  
Reply With Quote #5

Actually, the get_user_name native returns the string value of the hostname cvar if you pass an index which is lower than 1 or greater than 32.

Code:
(index < 1 || index > gpGlobals->maxClients) ? hostname->string : g_players[index].name.c_str()
from here (search for get_user_name)
__________________
hello, i am pm
PM is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-07-2006 , 16:10  
Reply With Quote #6

hmmm....didn't know that. I would have figured you would have just recieved a native error.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 20:23.


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