Raised This Month: $ Target: $400
 0% 

HELP !! get_user_name problem


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 07-02-2018 , 12:18   Re: HELP !! get_user_name problem
#1

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.
__________________

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

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
#3

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
#4

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
#5

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
#6

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
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 12:20.


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