AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   changing a players name ? (https://forums.alliedmods.net/showthread.php?t=53895)

Peoples Army 04-12-2007 21:23

changing a players name ?
 
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

pRED* 04-12-2007 21:33

Re: changing a players name ?
 
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 }

Peoples Army 04-12-2007 21:39

Re: changing a players name ?
 
ah ok thanks . now can you tell me how to compare steam ids ?

Zenith77 04-12-2007 22:04

Re: changing a players name ?
 
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      } }

stupok 04-12-2007 22:54

Re: changing a players name ?
 
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 :wink:.

Zenith77 04-13-2007 06:26

Re: changing a players name ?
 
;)


All times are GMT -4. The time now is 06:37.

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