| closed"Player" Name |
| Started by Ba5ic on 01-26-2008, 05:25 PM |
Threads: 26
Joined: Nov 2005
HirnrnHopefully 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.rnrnI would like a plugin that when somebody joins the server with the name "player" it does the following:rnrn* 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?.rnrnThey then have the option change it or be kicked after 60 seconds.rnrnI 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.rnrnThanks In Advance
Threads: 47
Joined: Apr 2007
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 :Pnnblobby
Threads: 26
Joined: Nov 2005
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 :PrnrnblobbyrnrnThanks Blobby :)
Threads: 14
Joined: Jan 2006
As a long time server operator, my advice is, don't do anything to them, why?rnrnThese 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.rnrnJust something to think about.
Threads: 47
Joined: Apr 2007
As a long time server operator, my advice is, don't do anything to them, why?rnrnThese 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.rnrnJust something to think about.rnrnrnYeah 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.
Threads: 26
Joined: Nov 2005
OkrnrnI've been thinking about this and taken on board peoples comments, how about look at it from another angle...rnrnWhen 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?. rnrnThat way the "new" player does not get kicked (kick = bad first impression) and secondly it's one less thing for the server admins.rnrnCould 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.rnrnJust a thought.rnrnThanks In Advance.
Threads: 26
Joined: Nov 2005
OkrnrnI've been thinking about this and taken on board peoples comments, how about look at it from another angle...rnrnWhen 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?. rnrnThat way the "new" player does not get kicked (kick = bad first impression) and secondly it's one less thing for the server admins.rnrnCould 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.rnrnJust a thought.rnrnThanks In Advance.rnrnCan anyone help me out here please :S
Threads: 6
Joined: Aug 2005
I think Diamond has already created something like this ?rnrnPeople 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.rnrnI could be wrong but i have seen this before. maybe its not his pugin.rnrnDiamond...rnrnThis is what i use. but it does temp ban them and ask's them to change their name.rnrn
rn#include <amxmodx>rn#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."rnpublic plugin_init()rn{rn register_plugin("Anti-Player", "1.00", "chris-1337");rn}rnpublic client_connect(id)rn{rn new name[33];rn get_user_name(id, name, sizeof(name)-1);rn if(equali(name, "player"))rn {rn console_print(id, BAN_REASON);rn server_cmd("banid 1 #%i kick", get_user_userid(id));rn }rn}rnThreads: 12
Joined: Aug 2006
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.
Threads: 26
Joined: Nov 2005
I think Diamond has already created something like this ?rnrnPeople 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.rnrnI could be wrong but i have seen this before. maybe its not his pugin.rnrnDiamond...rnrnThis is what i use. but it does temp ban them and ask's them to change their name.rnrnrnrnD-OrnrnWould you consider sharing you "Anti Player Name" plugin. Maybe pm me to discuss.rnrnTIA.rn#include <amxmodx>rn#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."rnpublic plugin_init()rn{rn register_plugin("Anti-Player", "1.00", "chris-1337");rn}rnpublic client_connect(id)rn{rn new name[33];rn get_user_name(id, name, sizeof(name)-1);rn if(equali(name, "player"))rn {rn console_print(id, BAN_REASON);rn server_cmd("banid 1 #%i kick", get_user_userid(id));rn }rn}rn
Threads: 75
Joined: Nov 2007
search at amxmodxs forum m8, there is more then one of these plugins ;)
Threads: 26
Joined: Nov 2005
search at amxmodxs forum m8, there is more then one of these plugins ;)rnrnThis is true, i found one by Brad, i don't really want to kick or ban peeps, just re-name them. Thats all!rnrn:)
Threads: 75
Joined: Nov 2007
There is one more ;)
Threads: 103
Joined: May 2005
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 timennbut there are definitly other ones out there that basically do the same thing.. or you could easily change that code posted to do it..nnlike replacen
nserver_cmd("banid 1 #%i kick", get_user_userid(id));with something likenclient_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 ideaThreads: 26
Joined: Nov 2005
or you could easily change that code posted to do it..rnrnlike replacernrnrnI tried replacing with the code you suggested but it gives a compile error.....with something likernrnserver_cmd("banid 1 #%i kick", get_user_userid(id));obviously thats extremely simple and it could be expanded on a real lot, but its the general ideaclient_cmd(id,"name ^"diamond-optic turns me on^"")
Threads: 103
Joined: May 2005
hmm idk it worked for me..nnheres the whole thing:n
#include <amxmodx>nn#define BAN_REASON "No clients named player allowed. Please change your name and then reconnect."nnpublic plugin_init()n{n register_plugin("Anti-Player", "1.00", "chris-1337")n}npublic client_connect(id)n{n new name[33];n get_user_name(id, name, sizeof(name)-1)n if(equali(name, "player"))n {n console_print(id, BAN_REASON)n client_cmd(id,"name ^"diamond-optic turns me on^"")n }n}Threads: 75
Joined: Nov 2007
Ok it seems A BIT useless unless u like: rnrn(1)diamond-optic turns me on rn(2)diamond-optic turns me on rn(3)diamond-optic turns me onrnrnon your server:D.rnrnU 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...rnrnGood luck..
Threads: 103
Joined: May 2005
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 duplicatesnnplus i also have it checking for like 25 or 30 names and not just 'Player' as welln..obviously its a bit more coding then that code above, but not really that much and its pretty basic stuff i guess..
Threads: 59
Joined: Jan 2007
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...rnrnDo me one favour, if you start writing a plugin like this, make me laugh and be original
Threads: 6
Joined: Nov 2007
lol @ Tank , nice and your right. rnrnI 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. rnrnDoing 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. rnrnI have to say I love the avamods supporters out there they are awsome!
Threads: 11
Joined: Dec 2007
Try this :nnVersion 1.01 Change :n- Empty lines in the NickName File are now ignorednn
#include <amxmodx>n#include <amxmisc>nn#define NICK_FILE "nickfiles.ini"n#define NICK_LEN 40n#define NICK_NB 30n#define charsof(%1) (sizeof(%1)-1)nn// NickName Arraynnew g_nickname[NICK_NB][NICK_LEN];nn// Total of NickNamennew g_totalNick;nn// Errornnew bool:g_error = false;nnpublic plugin_init()n{n // Plugin registrationn register_plugin("NoMorePlayer", "1.01", "h0_noMan");n n // Load NickFilen g_error = loadNickFile();n}nnpublic client_connect(id)n{n // If there were an error no nickname changen if(g_error)n return PLUGIN_CONTINUE;n n // Retrieving user nicknamen new name[NICK_LEN];n get_user_name(id, name, sizeof(name)-1);n n // New NickNamen new new_Name[NICK_LEN];n n // If user Nickname is PLAYERn if(equali(name, "player"))n {n // Giving a random Nikcnamen new_Name = g_nickname[random(g_totalNick)];nn // Commandn new command[60];n format(command, 59, "name ^"%s^"", new_Name);nn // Sending commandn client_cmd(id, command);n }n n return PLUGIN_CONTINUEn} nnbool:loadNickFile()n{n new buff[256];n new szText[NICK_LEN];n n // Total Nickn g_totalNick = -1 ; n n // Path of the NickName Filen new configdir[50]n new nickfile[70]n get_configsdir(configdir, 49);n format(nickfile, 69, "%s/%s", configdir, NICK_FILE);n n // Handlen new fp = fopen(nickfile, "r");n n // If an error occur return falsen if(fp==0)n return false;n n // File readingn while (!feof(fp))n {n // Buffer erasingn buff[0]='^0';n szText[0]='^0';n n // Read of the file line per linen fgets(fp, buff, charsof(buff)); n parse(buff, szText, charsof(szText));nn // NickName starting with a ; are ignoredn if (szText[0] != ';' && strlen(szText) != 0 )n {n // Add the Nickname to the Arrayn g_nickname[++g_totalNick] = szText;n }n }nn // Closing Handlen fclose(fp); nn // If no Nickname in the file return falsen if(g_totalNick!=0)n return true;nn return false;n}nnIt compiled fine for me but i havent tested it.nPut all the nickname in "nickfiles.ini"Threads: 26
Joined: Nov 2005
failed to compile for me......rnrntemp.sma(1) : error 055: start of function body without function headerrntemp.sma(3) : warning 218: old style prototypes used with optional semicolumnsrntemp.sma(3) : error 010: invalid function or declarationrntemp.sma(7) : error 010: invalid function or declarationrntemp.sma(9) : error 013: no entry point (no public functions)rnrnCan you post compiled version and i will test...rnrnTIA!
Threads: 11
Joined: Dec 2007
I compiled it with the lastest version (1.8.1).nI just tested it with the AMXMODX Web Compiler and worked fine.
Threads: 26
Joined: Nov 2005
nope - not working for me :(
Threads: 75
Joined: Nov 2007
It compiles fine for me aswell... here u go basic..rnrn*EDIT* I can see the attachment is peding for approval, so i guess u have to wait :)rnrnWell 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...
Threads: 59
Joined: Jan 2007
Or just use amxx studio to open, save and compile.rnrnThanks 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.
Threads: 26
Joined: Nov 2005
Put all the nickname in "nickfiles.ini"rnrnCompiled 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.rnrnchange your namernrnorrnrn"change your name"rnrnI presume this sits in the configs folder.rnrnTIA
Threads: 11
Joined: Dec 2007
This is how the NickName file should looks like :rnrnI edited my code to ignore empty lines in this file.rnrn
; This is the NickName filern; This files is used by the NoMorePlayer Pluginrn;rn; Nickname which start with a ; are ignoredrnrnNoMorePlayerrn;Nickname IgnoredrnAnother NickNamernPlayer is BadrnThreads: 59
Joined: Jan 2007
Perhaps a bit off-topic but since you are teaching us anyways I hope you are willing to help me with this question.rnrnWhat about certain symbols? Can anything be included?rnrnEven symbols like | , . ` ?
Threads: 11
Joined: Dec 2007
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 ")
Threads: 59
Joined: Jan 2007
Thanks for the reply. Since Im bored out of my head anyways I might as well give this a go :D
Threads: 28
Joined: Sep 2008
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.
Threads: 28
Joined: Sep 2008
I'm assuming that the nickfiles.ini should be in the configs folder like all the other plugin xxxx.ini files.
Threads: 75
Joined: Nov 2007
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 :)..
Threads: 59
Joined: Jan 2007
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.rnrnThe 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.rnrn
//=========================================================rn// Module Includesrn//=========================================================rn#include <amxmodx>rnrn//=========================================================rn// Version Settingsrn//=========================================================rn#define VERSION "0.1"rn#define SVERSION "v0.1 - by The Tank (www.clanbam.com)"rnrn//=========================================================rn// PCVARsrn//=========================================================rnnew p_enablernrn//=========================================================rn// Plugin Initializationrn//=========================================================rnpublic plugin_init() rn{ rn register_plugin("Tank's Name Changer",VERSION,"|B.A.M| The Tank")rn register_cvar("Tanks_NameChanger",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)rn rn p_enable = register_cvar("tanks_namechanger","1")rn}rnrn//=========================================================rn// A check on the name when the player is in the serverrn//=========================================================rnpublic client_putinserver(id)rn{rn if(get_pcvar_num(p_enable) && is_user_connected(id) && is_user_alive(id))rn {rn set_task(1.5, "check_name")rn }rn}rnrn//=========================================================rn// Once a info change is detected, perform check namern//=========================================================rnpublic client_infochanged(id)rn{rn if(get_pcvar_num(p_enable) && is_user_connected(id) && is_user_alive(id))rn {rn set_task(0.1, "check_name")rn }rn}rnrn//=========================================================rn// Here the name is being checked if needed changedrn//=========================================================rnpublic check_name( id )rn{rn new name[32]rn get_user_name( id, name, 31 )rn rn rn //=========================================================rn // Player/Unnamedrn //=========================================================rn if(equali(name, "somethingracial"))rn {rn client_cmd(id,"name ^"test^"")rn }rn}rnThreads: 75
Joined: Nov 2007
have u tryed to set the check to like 30 sek maybe more? and i think u are missing an "id"rn rn
set_task(1.5, "check_name") rnrnset_task(30, "check_name", id) Threads: 59
Joined: Jan 2007
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.nnAll it was the ID. Now I can finally finish my new plugin :D Much appiciated :D
Threads: 28
Joined: Sep 2008
So, do we have complete working code yet?
Threads: 59
Joined: Jan 2007
Yes we do.rnrnI 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:rnrnlinkrnrnA plugin posted by h0_noMan.rnrnHere you will find information about the ini file needed for this plugin.rnrnlink. Its even tested by the author, compiled fine and worked perfectly.
Threads: 28
Joined: Sep 2008
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.
Threads: 59
Joined: Jan 2007
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.
Threads: 75
Joined: Nov 2007
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 ;)
Threads: 59
Joined: Jan 2007
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 wheelrnrnIf 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.
Threads: 75
Joined: Nov 2007
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 ;)
Threads: 26
Joined: Nov 2005
So does anyone actually have this plugin installed and working on there server correctly?.rnrnTa
Threads: 59
Joined: Jan 2007
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.rnrnJust need to put it all together. You interested in it?
Threads: 26
Joined: Nov 2005
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.rnrnJust need to put it all together. You interested in it?rnrnrnHey Tank, i'd be more than happy to try out what you have on my server! :).rnrnLet me know.rnrnCheers!
Threads: 59
Joined: Jan 2007
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.rnrnI 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).rnrnThe 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.
Threads: 2
Joined: Apr 2007
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
Threads: 59
Joined: Jan 2007
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.rnrnThe information to create this plugin is provided in this thread so there is no man overboard (perhaps a woman but i'll save her)

