View Full Version : "Player" Name
Ba5ic
01-26-2008, 05:25 PM
Hi
Hopefully a small request to one of the "coding gods". I seem to get alot of pple who join my server with the default name of "player", i ask nicely for them to change it to something unique, if they don't i do it for them which is frankly a pain in the bum.
I would like a plugin that when somebody joins the server with the name "player" it does the following:
* Displays a message in centre screen in red with say the following text " you have 60 seconds to change your name or you will be removed from the Drunktank. Can it then show in red a 60 second count down?.
They then have the option change it or be kicked after 60 seconds.
I have looked over in the amxx forums and found something by Xanimos & TwistedEuphoria but it's not what i'm looking for, hence my request.
Thanks In Advance
blobby
01-26-2008, 06:30 PM
I get alot of people coming on my servers as player and normally they just tk everyone so i just kick them of they get kicked for to many tks.... But i could see this been good and very useful so im sure someone will have a go at doing it if i get a spare 30/40mins ill have a go myself :P
blobby
Ba5ic
01-27-2008, 09:08 AM
I get alot of people coming on my servers as player and normally they just tk everyone so i just kick them of they get kicked for to many tks.... But i could see this been good and very useful so im sure someone will have a go at doing it if i get a spare 30/40mins ill have a go myself :P
blobby
Thanks Blobby :)
WARDOG
01-28-2008, 06:58 AM
As a long time server operator, my advice is, don't do anything to them, why?
These are usually new people who don't even know how to change there name yet. Unless they give you problems (like in Blobbys case it's an ff server doesn't go with noobs well), I just leave them be. You may be kicking a future regular out of your server, and donator, and they will never come back to your server again after there expierience with you.
Just something to think about.
blobby
01-28-2008, 10:05 AM
As a long time server operator, my advice is, don't do anything to them, why?
These are usually new people who don't even know how to change there name yet. Unless they give you problems (like in Blobbys case it's an ff server doesn't go with noobs well), I just leave them be. You may be kicking a future regular out of your server, and donator, and they will never come back to your server again after there expierience with you.
Just something to think about.
Yeah hes right in most cases they are newbies thats why they tk because they don't even know that there are 2 differnt teams and things.
Ba5ic
02-23-2008, 05:41 PM
Ok
I've been thinking about this and taken on board peoples comments, how about look at it from another angle...
When someone joins the server with the name "player" and yes this might be there very first time to play the game (unlikely), instead of kicking can the plugin check for the name "player" and change it automatically from a selection of names possibly held in a .ini file?.
That way the "new" player does not get kicked (kick = bad first impression) and secondly it's one less thing for the server admins.
Could it also check for www. names and server IP's, as we get alot of pple join with IP's and WWW addy's as there names.
Just a thought.
Thanks In Advance.
Ba5ic
03-01-2008, 04:58 PM
Ok
I've been thinking about this and taken on board peoples comments, how about look at it from another angle...
When someone joins the server with the name "player" and yes this might be there very first time to play the game (unlikely), instead of kicking can the plugin check for the name "player" and change it automatically from a selection of names possibly held in a .ini file?.
That way the "new" player does not get kicked (kick = bad first impression) and secondly it's one less thing for the server admins.
Could it also check for www. names and server IP's, as we get alot of pple join with IP's and WWW addy's as there names.
Just a thought.
Thanks In Advance.
Can anyone help me out here please :S
jondoe
03-01-2008, 10:19 PM
I think Diamond has already created something like this ?
People that play on his server and have the name player, get renamed i played at avamods on xx-xx-xx were the x's is the date they played on his server.
I could be wrong but i have seen this before. maybe its not his pugin.
Diamond...
This is what i use. but it does temp ban them and ask's them to change their name.
#include <amxmodx>
#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."
public plugin_init()
{
register_plugin("Anti-Player", "1.00", "chris-1337");
}
public client_connect(id)
{
new name[33];
get_user_name(id, name, sizeof(name)-1);
if(equali(name, "player"))
{
console_print(id, BAN_REASON);
server_cmd("banid 1 #%i kick", get_user_userid(id));
}
}
{DwP} 325th ABN
03-02-2008, 04:31 AM
this has come up before on my server, i am like the rest why care leave them be who cares if your name is player. the problem i think with many is the stats part all the sudden you have players and players in the phycho stats spamming up. i gives a damn does it really matter in the big picture. anyhoo i think thats the big problem stats.
Ba5ic
10-26-2008, 10:39 AM
I think Diamond has already created something like this ?
People that play on his server and have the name player, get renamed i played at avamods on xx-xx-xx were the x's is the date they played on his server.
I could be wrong but i have seen this before. maybe its not his pugin.
Diamond...
This is what i use. but it does temp ban them and ask's them to change their name.
#include <amxmodx>
#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."
public plugin_init()
{
register_plugin("Anti-Player", "1.00", "chris-1337");
}
public client_connect(id)
{
new name[33];
get_user_name(id, name, sizeof(name)-1);
if(equali(name, "player"))
{
console_print(id, BAN_REASON);
server_cmd("banid 1 #%i kick", get_user_userid(id));
}
}
D-O
Would you consider sharing you "Anti Player Name" plugin. Maybe pm me to discuss.
TIA.
search at amxmodxs forum m8, there is more then one of these plugins ;)
Ba5ic
10-26-2008, 01:02 PM
search at amxmodxs forum m8, there is more then one of these plugins ;)
This is true, i found one by Brad, i don't really want to kick or ban peeps, just re-name them. Thats all!
:)
diamond-optic
10-26-2008, 01:20 PM
well i dont see myself releasing mine anytime soon lol.. especially since its all hard coded stuff which i hate having in a public plugin.. not to mention i have several dozen other plugins that have been waiting in line for an extremely long time
but there are definitly other ones out there that basically do the same thing.. or you could easily change that code posted to do it..
like replace
server_cmd("banid 1 #%i kick", get_user_userid(id));with something like
client_cmd(id,"name ^"diamond-optic turns me on^"")obviously thats extremely simple and it could be expanded on a real lot, but its the general idea
Ba5ic
10-26-2008, 03:37 PM
or you could easily change that code posted to do it..
like replace
server_cmd("banid 1 #%i kick", get_user_userid(id));with something like
client_cmd(id,"name ^"diamond-optic turns me on^"")obviously thats extremely simple and it could be expanded on a real lot, but its the general idea
I tried replacing with the code you suggested but it gives a compile error.....
diamond-optic
10-26-2008, 05:09 PM
hmm idk it worked for me..
heres the whole thing:
#include <amxmodx>
#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."
public plugin_init()
{
register_plugin("Anti-Player", "1.00", "chris-1337")
}
public client_connect(id)
{
new name[33];
get_user_name(id, name, sizeof(name)-1)
if(equali(name, "player"))
{
console_print(id, BAN_REASON)
client_cmd(id,"name ^"diamond-optic turns me on^"")
}
}
Ok it seems A BIT useless unless u like:
(1)diamond-optic turns me on
(2)diamond-optic turns me on
(3)diamond-optic turns me on
on your server:D.
U need some cases it can pick from, and some something that dont make yesterdays "diamond-optic turns me on" to "(1)diamond-optic turns me on" the next day. Like a date or precis time a day, just like D-O does on his server. And that reason make it a bit more coding then the one above, actully alot more i can imagien...
Good luck..
diamond-optic
10-27-2008, 01:16 AM
well i still get lots of (1).... and stuff on my server, just when it changes the name it selects randomly from like 8 or 10 names or something which cuts down on the duplicates
plus i also have it checking for like 25 or 30 names and not just 'Player' as well
..obviously its a bit more coding then that code above, but not really that much and its pretty basic stuff i guess..
After seeing the explanation of D-O I kinda have the feeling my server will be filled with people having names of communities like Owned on avamods, a GSR server, clanbam.com...
Do me one favour, if you start writing a plugin like this, make me laugh and be original
RollinDeath
11-10-2008, 02:43 AM
lol @ Tank , nice and your right.
I actually do not run a automatic name changer. I have the amxmodmenu clcmd.ini set with the options to change names for my admins who want to handle more administrative duties. The fact that these people are having troubles naming themselves is annoying and I try to help them when I see them.
Doing tags or websites could cause needless confusion. I know when some one named PottyMouth comes along and I know where they come from 76AD servers and I tell admins to be watching cause those peeps might get to rowdy.
I have to say I love the avamods supporters out there they are awsome!
h0_noMan
11-10-2008, 11:35 AM
Try this :
Version 1.01 Change :
- Empty lines in the NickName File are now ignored
#include <amxmodx>
#include <amxmisc>
#define NICK_FILE "nickfiles.ini"
#define NICK_LEN 40
#define NICK_NB 30
#define charsof(%1) (sizeof(%1)-1)
// NickName Array
new g_nickname[NICK_NB][NICK_LEN];
// Total of NickName
new g_totalNick;
// Error
new bool:g_error = false;
public plugin_init()
{
// Plugin registration
register_plugin("NoMorePlayer", "1.01", "h0_noMan");
// Load NickFile
g_error = loadNickFile();
}
public client_connect(id)
{
// If there were an error no nickname change
if(g_error)
return PLUGIN_CONTINUE;
// Retrieving user nickname
new name[NICK_LEN];
get_user_name(id, name, sizeof(name)-1);
// New NickName
new new_Name[NICK_LEN];
// If user Nickname is PLAYER
if(equali(name, "player"))
{
// Giving a random Nikcname
new_Name = g_nickname[random(g_totalNick)];
// Command
new command[60];
format(command, 59, "name ^"%s^"", new_Name);
// Sending command
client_cmd(id, command);
}
return PLUGIN_CONTINUE
}
bool:loadNickFile()
{
new buff[256];
new szText[NICK_LEN];
// Total Nick
g_totalNick = -1 ;
// Path of the NickName File
new configdir[50]
new nickfile[70]
get_configsdir(configdir, 49);
format(nickfile, 69, "%s/%s", configdir, NICK_FILE);
// Handle
new fp = fopen(nickfile, "r");
// If an error occur return false
if(fp==0)
return false;
// File reading
while (!feof(fp))
{
// Buffer erasing
buff[0]='^0';
szText[0]='^0';
// Read of the file line per line
fgets(fp, buff, charsof(buff));
parse(buff, szText, charsof(szText));
// NickName starting with a ; are ignored
if (szText[0] != ';' && strlen(szText) != 0 )
{
// Add the Nickname to the Array
g_nickname[++g_totalNick] = szText;
}
}
// Closing Handle
fclose(fp);
// If no Nickname in the file return false
if(g_totalNick!=0)
return true;
return false;
}
It compiled fine for me but i havent tested it.
Put all the nickname in "nickfiles.ini"
Ba5ic
11-10-2008, 02:16 PM
failed to compile for me......
temp.sma(1) : error 055: start of function body without function header
temp.sma(3) : warning 218: old style prototypes used with optional semicolumns
temp.sma(3) : error 010: invalid function or declaration
temp.sma(7) : error 010: invalid function or declaration
temp.sma(9) : error 013: no entry point (no public functions)
Can you post compiled version and i will test...
TIA!
h0_noMan
11-10-2008, 04:34 PM
I compiled it with the lastest version (1.8.1).
I just tested it with the AMXMODX Web Compiler and worked fine.
Ba5ic
11-10-2008, 05:15 PM
nope - not working for me :(
It compiles fine for me aswell... here u go basic..
*EDIT* I can see the attachment is peding for approval, so i guess u have to wait :)
Well copy the code above, make a new .txt file, open it with wordpad, paste the code, save and close the file. rename the file to .sma and compile...
Or just use amxx studio to open, save and compile.
Thanks for the coding though, although I like the idea of the plugin, it doesn't really suit my needs. But now I do have a start on my own project.
Ba5ic
11-11-2008, 06:32 AM
Put all the nickname in "nickfiles.ini"
Compiled and installed, one last question regarding the nickfiles.ini, the names the "player will be changed to, is there any specific format they need to entered?, ie.
change your name
or
"change your name"
I presume this sits in the configs folder.
TIA
h0_noMan
11-11-2008, 10:22 AM
This is how the NickName file should looks like :
I edited my code to ignore empty lines in this file.
; This is the NickName file
; This files is used by the NoMorePlayer Plugin
;
; Nickname which start with a ; are ignored
NoMorePlayer
;Nickname Ignored
Another NickName
Player is Bad
Perhaps a bit off-topic but since you are teaching us anyways I hope you are willing to help me with this question.
What about certain symbols? Can anything be included?
Even symbols like | , . ` ?
h0_noMan
11-11-2008, 11:26 AM
I havent tested it but i am pretty sure you can use all the characters that are used in game (the only character avoided is the double quote ")
Thanks for the reply. Since Im bored out of my head anyways I might as well give this a go :D
gunsofnavarone
12-06-2008, 11:27 AM
I don't know what's wrong, I've installed the NoMorePlayers plugin (compiled the sma file and uploaded to server), created the nickfiles.ini file, but it doesn't change the name "Player". (I modified the sma file from "player" to "Player"). In either case, player vs Player, nothing is happening, though when amx_plugins is typed in console, it says it's running.
gunsofnavarone
12-06-2008, 11:28 AM
I'm assuming that the nickfiles.ini should be in the configs folder like all the other plugin xxxx.ini files.
maybe client_connect should set a task lige 45 sec after the connect... if its trying to change name on the target while not on a team or dead it will fail the rename cmd, it would also give the poor player a chance to change name :)..
Can someone explain to me why this isn't working? I looked up both client_putinserver as client_infochanged and they seem to be working like amxmodx functions explains it.
The only thing I could think of is that players can't change their name while not being on a team. Although I haven't found the right format (didn't want to place 3 times the same coding for the 3 teams and haven't figured out how to make that smaller) I tested it on my server while being on a team and still nothing.
//================================================== =======
// Module Includes
//================================================== =======
#include <amxmodx>
//================================================== =======
// Version Settings
//================================================== =======
#define VERSION "0.1"
#define SVERSION "v0.1 - by The Tank (www.clanbam.com)"
//================================================== =======
// PCVARs
//================================================== =======
new p_enable
//================================================== =======
// Plugin Initialization
//================================================== =======
public plugin_init()
{
register_plugin("Tank's Name Changer",VERSION,"|B.A.M| The Tank")
register_cvar("Tanks_NameChanger",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
p_enable = register_cvar("tanks_namechanger","1")
}
//================================================== =======
// A check on the name when the player is in the server
//================================================== =======
public client_putinserver(id)
{
if(get_pcvar_num(p_enable) && is_user_connected(id) && is_user_alive(id))
{
set_task(1.5, "check_name")
}
}
//================================================== =======
// Once a info change is detected, perform check name
//================================================== =======
public client_infochanged(id)
{
if(get_pcvar_num(p_enable) && is_user_connected(id) && is_user_alive(id))
{
set_task(0.1, "check_name")
}
}
//================================================== =======
// Here the name is being checked if needed changed
//================================================== =======
public check_name( id )
{
new name[32]
get_user_name( id, name, 31 )
//================================================== =======
// Player/Unnamed
//================================================== =======
if(equali(name, "somethingracial"))
{
client_cmd(id,"name ^"test^"")
}
}
have u tryed to set the check to like 30 sek maybe more? and i think u are missing an "id"
set_task(1.5, "check_name")
set_task(30, "check_name", id)
Ah shit, you have no idea how much you helped me. I already had 7 different versions with all different functions to see if I did something wrong with functions etc.
All it was the ID. Now I can finally finish my new plugin :D Much appiciated :D
gunsofnavarone
12-07-2008, 02:57 PM
So, do we have complete working code yet?
Yes we do.
I would like to point out that although one first sight all posts look chatter. But there is a lot information to find from conversation-posts made by users. For instance, one page back you will find this:
link (http://www.dodplugins.net/forums/showpost.php?p=10966&postcount=21)
A plugin posted by h0_noMan.
Here you will find information about the ini file needed for this plugin.
link (http://www.dodplugins.net/forums/showpost.php?p=10973&postcount=28). Its even tested by the author, compiled fine and worked perfectly.
gunsofnavarone
12-07-2008, 03:27 PM
I mean no disrespect, but I tried that code and it didn't do anything on my server. Please note my comments above as to what action I took to install it.
Well, im completely redoing my plugin, so don't hold your breath on me. Besides that, this is what I call out of my league.
as said maybe on page 2 in this thread there is already made a plugin that doesnt allow some names. look at amxmodx's forum and search.. try searching on just name ie... no need to reinvent the wheel ;)
as said maybe on page 2 in this thread there is already made a plugin that doesnt allow some names. look at amxmodx's forum and search.. try searching on just name ie... no need to reinvent the wheel
If this was directed to me...this is just a learing process for me. I might not even use the plugin in the end. Heck, half of the plugins I made I don't use because they could be buggy as hell. And besides that, I'm using a piece of code I borrowed so I can't even release mine.
lol it wasnt meant diretly to u tank, it was just a help to the guys that reads this thread... i missing around with codes myself aswell, and i understand your way of learning it, i do it the excact same way ;)
Ba5ic
12-17-2008, 05:07 AM
So does anyone actually have this plugin installed and working on there server correctly?.
Ta
I got a test version although still needs a lot of work. I basicly got all the files needed + an example from an already fixed plugin to finish my own.
Just need to put it all together. You interested in it?
Ba5ic
12-17-2008, 09:27 AM
I got a test version although still needs a lot of work. I basicly got all the files needed + an example from an already fixed plugin to finish my own.
Just need to put it all together. You interested in it?
Hey Tank, i'd be more than happy to try out what you have on my server! :).
Let me know.
Cheers!
Im off tomorrow so I'll see what I can put together tomorrow. I'll contact you once it's done. However it might not completely be what was posted in this thread.
I figured I wanted to block some more names and also give people the chance to change their name with a /name chat command since for some people it's too hard to use console (no idea why though).
The last time I worked on it everything worked however I wanted to change it around to a somewhat faster method. I'll keep you updated.
Myers [93rd ID]
12-20-2008, 06:13 PM
AVA servers have a plugin like this and u see it alot in CS server where the person who joins name is Player then the game automatically changes the persons name to something else for instance in AVA servers they change the name to Owned|on|AVA|on12/19/08 ask one of the admins on them if u can buy their plugin or ask them for a public release for it im sure they would part with it
I think you are referring to Avamods, the server admin and founder is a site admin on here. Diamond-Optic hates releasing plugins which were hardcoded for his server which I completely understand.
The information to create this plugin is provided in this thread so there is no man overboard (perhaps a woman but i'll save her)
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.