AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   name prefix (https://forums.alliedmods.net/showthread.php?t=113676)

Sandro Gubeladze 12-29-2009 07:19

name prefix
 
hey, I wanted to create plugin which will add prefix to client's name.
example: player conects to the server whose name is "NAME", and his name will be changed into "[player] NAME"
I tried this code but did't help:

PHP Code:

public client_connect(id) {
      new 
name[32]
      
get_user_name(idname31)
      
client_cmd(idname, ^"[player] %s^"name)



#8 SickneSS 12-29-2009 09:42

Re: name prefix
 
Code:
client_cmd(id,"name ^"[player] %s^"",name)

Starsailor 12-29-2009 10:33

Re: name prefix
 
or

PHP Code:

public client_connect(id)

      new 
szName[32], szNameFinal[32
      
get_user_name(idszNamecharsmax(szName)) 
      
format(szNameFinal,charsmax(szNameFinal),"[Player] ^"%s^"",szName)
      
set_user_info(id,"name",szNameFinal)



Sandro Gubeladze 12-29-2009 11:46

Re: name prefix
 
thanks guys :) (i have to wait 24 hours to give karma :D)

Mxnn 12-29-2009 13:08

Re: name prefix
 
Mmm i have a question.. If you change a name when a client connects to you server, is not slowhacking?
Should not change the name when it disconnects?

fysiks 12-29-2009 19:07

Re: name prefix
 
I wrote this a few times :) Here is one.

Quote:

Originally Posted by Mxnn (Post 1035401)
Mmm i have a question.. If you change a name when a client connects to you server, is not slowhacking?
Should not change the name when it disconnects?

Technically yes. But, if you use set_user_info() like myself and starsailor then it is not.

Sandro Gubeladze 12-30-2009 11:42

Re: name prefix
 
is it slowhacking if everyone's name starts with one word ?

fysiks 12-30-2009 11:44

Re: name prefix
 
Quote:

Originally Posted by Sandro Gubeladze (Post 1036567)
is it slowhacking if everyone's name starts with one word ?

If you change it on the client, yes.

anakin_cstrike 12-30-2009 13:41

Re: name prefix
 
Quote:

Originally Posted by Starsailor (Post 1035187)
or

PHP Code:

public client_connect(id)

      new 
szName[32], szNameFinal[32
      
get_user_name(idszNamecharsmax(szName)) 
      
format(szNameFinal,charsmax(szNameFinal),"[Player] ^"%s^"",szName)
      
set_user_info(id,"name",szNameFinal)



Or without "szNameFInal"


All times are GMT -4. The time now is 04:07.

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