Raised This Month: $ Target: $400
 0% 

get_user_name ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-23-2012 , 14:56   Re: get_user_name ?
Reply With Quote #3

It's a string, not an array. The number means it can have 18 characters max. It looks exactly like an array because it works similiar to this:
Code:
new string[ 2 ] format( string, 1 /* max characters - 1 */, "oh" ) // we're copying "oh" into variable string string[ 0 ] = 'o' string[ 1 ] = 'h'
For a name, you should put 32 there, because 18 will not be enough if the player's nick reaches 18 characters and part of it will be cut off.

For the second question, id is the player index. It starts from 1 and ends with 32. It is passed in forwards like client_connect( id ). In your example, it means you're getting the name of player with index id.
name means you're copying the user's name into name string.
It is 17 because every string starts from 0 (not 1, see my example above), thus it's always max characters - 1.

For the third question, see above.

Last edited by Backstabnoob; 06-23-2012 at 14:56.
Backstabnoob is offline
 



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 06:15.


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