Raised This Month: $51 Target: $400
 12% 

HELP !! get_user_name problem


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 12:26   Re: HELP !! get_user_name problem
#11

If you guys think you cant get problem cause code is too little then you are wrong. Actually you can get problem cause without that code, there's id = 0, cause get_user_name returns server name (hostname) when first param (player id) equals to zero.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-02-2018 at 12:30.
Ghosted is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 13:44   Re: HELP !! get_user_name problem
#12

Quote:
Originally Posted by Relaxing View Post
Code:
public hudmessage(id){        if(!file_exists(dir))         write_file(dir,"Welcome to our Server ! GL & HF");         new szText[64+32];     static szName[32];         read_file(dir, 0, szText, charsmax(szText));     get_user_name(id,szName,charsmax(szName));         formatex(szText, charsmax(szText), "sup bro %s^nWelcome to our Server ! GL & HF", szName);     set_hudmessage(0, 255, 0, 0.38, 0.56, 0, 6.0, 12.0)     show_hudmessage(id, "%s" ,szText) }
It reads what's inside "dir" file and saves into an array. Then, gets user name and use formatex() to fit it all together in previous array.
Bro I need something else .My code is correct (I guess) but insted of name outputs server name.
I tried with clcmd same code of getting name and it works perfectly

Code:
register_clcmd("say /name","name")
	new szName[32]
	get_user_name(id,szName,charsmax(szName))
client_print(print_chat,"%s is ur name",szName)
but idk why it doesnt work on the code that I shared
thEsp is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 14:04   Re: HELP !! get_user_name problem
#13

Quote:
Originally Posted by thEsp View Post
Bro I need something else .My code is correct (I guess) but insted of name outputs server name.
I tried with clcmd same code of getting name and it works perfectly

Code:
register_clcmd("say /name","name")
	new szName[32]
	get_user_name(id,szName,charsmax(szName))
client_print(print_chat,"%s is ur name",szName)
but idk why it doesnt work on the code that I shared
Hello?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 14:37   Re: HELP !! get_user_name problem
#14

Quote:
Originally Posted by Ghosted View Post
Hello?
Try it yourself then talk -_-

Last edited by thEsp; 07-02-2018 at 14:38.
thEsp is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 15:04   Re: HELP !! get_user_name problem
#15

Quote:
Originally Posted by thEsp View Post
Try it yourself then talk -_-
What? dont wanted to say but, they are right, you are actually moron [at least idiot].
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-02-2018 at 15:07.
Ghosted is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 15:11   Re: HELP !! get_user_name problem
#16

Quote:
Originally Posted by Ghosted View Post
What? dont wanted to say but, they are right, you are actually moron [at least idiot].
Okey ,deal with admin
Bad attitude
thEsp is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 07-02-2018 , 16:03   Re: HELP !! get_user_name problem
#17

Code:
register_clcmd("myname", "clcmd_name") public clcmd_name(id){     static name[32]     get_user_name(id, name, charsmax(name))     console_print(id, "%s", name) }
Does this prints server's name?
__________________
Relaxing is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 16:38   Re: HELP !! get_user_name problem
#18

Quote:
Originally Posted by Relaxing View Post
Code:
register_clcmd("myname", "clcmd_name") public clcmd_name(id){     static name[32]     get_user_name(id, name, charsmax(name))     console_print(id, "%s", name) }
Does this prints server's name?
Nope bro it doesnt,it works perfectly but idk why it outputs server name in code I inclded
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-02-2018 , 18:00   Re: HELP !! get_user_name problem
#19

Because id is 0 in your code. Show us where the hudmessage function is used.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-03-2018 , 05:00   Re: HELP !! get_user_name problem
#20

Quote:
Originally Posted by OciXCrom View Post
Because id is 0 in your code. Show us where the hudmessage function is used.
I said that in previous post, and he didn't even read. Then why he even asked for help? That's in my previous post too.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
Closed Thread



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 09:18.


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