AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change Nick (TAG) (https://forums.alliedmods.net/showthread.php?t=49888)

BloodyNuker 01-14-2007 23:45

Change Nick (TAG)
 
I have got to put a tag to the players automatically, but when a player have got a number on the nick, or a "." or "/" or.. "(" etc i cant change nick.. this is the code...

Code:
new name[32]; get_user_name(id, name, 31); if(containi(name, "[TAG] - ") > -1)       {     return PLUGIN_HANDLED;       }       else       {     client_cmd(id,"name ^"[TAG] - %s^"",name);       }

If any can help.. cyas

s p l i t 01-15-2007 00:37

Re: Change Nick (TAG)
 
Code:
new name[32], name2[32] get_user_name(id, name, 31) get_user_name(id, name2, 31) if(name[0]!='[' && name[1]!='T' && name[2]!='A' && name[3]!='G' && name[4]!=']'){    client_cmd(id,"name ^"[TAG] - %s^"",name2) }

dutchmeat 01-15-2007 04:03

Re: Change Nick (TAG)
 
I don't get this, you want to check if the players name is like this:
[TAG] - name
and then change it to
[TAG] - name
But that's not the problem, you are using the variable 'name', but 'name' is '[TAG] name'
so you change the name to:
[TAG] - [TAG] - name.

BloodyNuker 01-15-2007 11:14

Re: Change Nick (TAG)
 
emm I think.. and the problem to detect the name no it is.
The problem is to change name to a player... when this player have got numbers or "$" simbols. Examples with my plugin:

If a player have got name "CAT" the plugin put him:

[TAG] - CAT

If a player have got name "[TAG] - CAT" donīt happend nothing.

If aplayer have got name "110" the plugin put him:

110

Here is the problem.. the plugin canīt put "[TAG] - " & name... i think.. the problem is en the "&"

BloodyNuker 01-15-2007 11:43

Re: Change Nick (TAG)
 
Sorry.. i donīt know why canīt edit the other post :/ (Im logged)

If a player into the server have got name CAT... and the server put him [TAG] - CAT... when a player put him 123, the plugin put him [TAG] - 123...

But if a player have got name 123 when entering in the server, the plugin canīt change the nick.. :S

This is very crazy! OMG

If any donīt know why, and can help.. i post the plugin

Code:
#include <amxmodx> #include <engine> #include <amxmisc> #include <fakemeta> new Plugin_Author[] = "start"; new Plugin_Version[] = "1.0"; new Plugin_Name[] = "lol" public plugin_init() {     register_plugin(Plugin_Name,Plugin_Version,Plugin_Author); } public client_putinserver(id) { set_task(1.0,"fnCheck1",id) } public client_infochanged(id) {             new name[32];                 get_user_name(id, name, 31);             if(containi(name, "[TAG] - ") > -1)                     {                     return PLUGIN_HANDLED;                 }                 else                 {                     client_cmd(id,"name ^"[TAG] - %s^"",name);                 } } public fnCheck1(id) {             new name[32];                 get_user_name(id, name, 31);             if(containi(name, "[TAG] - ") > -1)                     {                     return PLUGIN_HANDLED;                 }                 else                 {                     client_cmd(id,"name ^"[TAG] - %s^"",name);                 } }


All times are GMT -4. The time now is 22:23.

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