Raised This Month: $ Target: $400
 0% 

changing a players name ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-12-2007 , 21:23   changing a players name ?
Reply With Quote #1

i was wondering the best way to change a players name when he enters the server. i dont see any functions directly related to set_name or anything
thanks
Peoples Army is offline
pRED*
Join Date: Dec 2006
Old 04-12-2007 , 21:33   Re: changing a players name ?
Reply With Quote #2

You should look in the scripting folder at the sma files for the amxx core plugins..

From admincmd.sma..

Code:
public cmdNick(id, level, cid) {     if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED     new arg1[32], arg2[32], authid[32], name[32], authid2[32], name2[32]     read_argv(1, arg1, 31)     read_argv(2, arg2, 31)     new player = cmd_target(id, arg1, 1)         if (!player)         return PLUGIN_HANDLED     get_user_authid(id, authid, 31)     get_user_name(id, name, 31)     get_user_authid(player, authid2, 31)     get_user_name(player, name2, 31)     client_cmd(player, "name ^"%s^"", arg2)     log_amx("Cmd: ^"%s<%d><%s><>^" change nick to ^"%s^" ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, arg2, name2, get_user_userid(player), authid2)     switch (get_cvar_num("amx_show_activity"))     {         case 2: client_print(0, print_chat, "%L", LANG_PLAYER, "ADMIN_NICK_2", name, name2, arg2)         case 1: client_print(0, print_chat, "%L", LANG_PLAYER, "ADMIN_NICK_1", name2, arg2)     }     console_print(id, "[AMXX] %L", id, "CHANGED_NICK", name2, arg2)     return PLUGIN_HANDLED }
pRED* is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-12-2007 , 21:39   Re: changing a players name ?
Reply With Quote #3

ah ok thanks . now can you tell me how to compare steam ids ?
Peoples Army is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-12-2007 , 22:04   Re: changing a players name ?
Reply With Quote #4

Code:
CompareAuth(id1, id2) {      new auth1[32]      new auth2[32];      get_user_authid(id, auth1, 31);      get_user_authid(id, auth2, 31);      if (equal(auth1, auth2))      {            // They're equal      } else {            // They're not equal      } }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-12-2007 , 22:54   Re: changing a players name ?
Reply With Quote #5

Code:
CompareAuth(id1, id2) {      new auth1[32]      new auth2[32];      get_user_authid(id1, auth1, 31);      get_user_authid(id2, auth2, 31);      if (equal(auth1, auth2))      {            // They're equal      } else {            // They're not equal      } }

Good old typo's .
stupok is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-13-2007 , 06:26   Re: changing a players name ?
Reply With Quote #6

;)
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
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 06:38.


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