AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Read players TAG Name (https://forums.alliedmods.net/showthread.php?t=49729)

BloodyNuker 01-11-2007 20:16

Read players TAG Name
 
Hi, i need cut letters from words, to show the clan TAG for example:

[TAG] - Name1
[TAG] - Name2
If the player donīt have the tag.. for example
Name3, the plugin must put him
[TAG] - Name3

Any can help me?

I donīt know what function need, i think .. i need str(, But i donīt know

:/

BloodyNuker 01-11-2007 20:37

Re: Read players TAG Name
 
I search again and found the solution... plz delet my post, sorry


http://forums.alliedmods.net/showthr...light=clan+tag

hlstriker 01-11-2007 20:49

Re: Read players TAG Name
 
I was writing this while you found the other post, I'm going to post it anyway :)

Code:
public checkName() {     new players[32], name[32], tagName[16];     new i, playerCount, player;         tagName = "[TAG]";         get_players(players, playerCount, "ch");  // c is skip bots, h is skip hltv         // Loop through all the players.     for(i = 0; i < playerCount; i++) {         player = players[i];         get_user_name(player, name, 31);                 // Check to see if their name contains the tag.         if(containi(name, tagName) == -1) {             // Run a command on the client to set their name to "[TAG] TheirName"             // Then notify them that their name has been changed to contain the tag.             client_cmd(player, "name ^"%s %s^"", tagName, name);             client_print(player, print_chat, "Your name has been changed to use the clan tag.");         }     }         return PLUGIN_CONTINUE; }

It should work :P

dutchmeat 01-12-2007 04:25

Re: Read players TAG Name
 
This really just a simple example, this also can't recognize if the name is this: "[tag]playername" plus the most important thing is, you want them to recognize a '[' ']' tag, not '[TAG]' (unless your clanname is called 'tag').
try using a regular expression instead of equal


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

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