Raised This Month: $ Target: $400
 0% 

Set new name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 01-12-2011 , 07:58   Set new name
Reply With Quote #1

How do I properly set a new name for a client?

I know how to get the name the client already has, but not sure how to set a new one without slowhacking them.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 01-12-2011 , 09:04   Re: Set new name
Reply With Quote #2

PHP Code:
set_user_info(index"name""nnajko"
nnajko is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 01-12-2011 , 09:35   Re: Set new name
Reply With Quote #3

Nice, thanks!

But what if I have an array which contains a name, and I want to give that name to the player, but also something else in front of it?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-12-2011 , 09:36   Re: Set new name
Reply With Quote #4

Use format and for the third parameter of set_user_info put the formatted string in.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 01-12-2011 , 09:55   Re: Set new name
Reply With Quote #5

PHP Code:
new Name[32]
    
get_user_name(idname31)
    
    new 
FormatName
    format
(FormatName31Name
Then do set_user_info(id, "name", "[InFrontOfName]"FormatName)?

Never done this before and I am a bit confused regarding the format stuff.
__________________
No idea what to write here...

Last edited by Jelle; 01-12-2011 at 10:00.
Jelle is offline
Send a message via MSN to Jelle
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-12-2011 , 10:32   Re: Set new name
Reply With Quote #6

PHP Code:
new array[] = "name";
new 
prefix[] = "[prefix]";

new 
Name[35];
formatex(Namecharsmax(Name), "%s %s"prefix, array);
set_user_info(id"name"Name); 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 01-12-2011 , 14:34   Re: Set new name
Reply With Quote #7

Thanks. I think I got it working.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 02:11.


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