Raised This Month: $51 Target: $400
 12% 

nickname changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
samobiezny133
Junior Member
Join Date: Jan 2024
Old 01-12-2024 , 22:54   nickname changer
Reply With Quote #1

Hello, I would like to create a plugin that changes the nickname of each player joining the server to one of the nicknames from my pool. I would also like the plugin to draw a nickname from the pool every time the map changes, and so that the drawn nickname cannot be changed by the player.
How to do it?

Last edited by samobiezny133; 01-12-2024 at 23:11.
samobiezny133 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-13-2024 , 17:09   Re: nickname changer
Reply With Quote #2

I basically do this already but specifically for players who have the default name "Player". You should be able to modify it as needed. You'll have to change the logic for preventing a name change because I only disallow "Player" but it shouldn't be that hard.

https://github.com/fysiks1/amxx-noplayername

There are other examples out there for preventing name changes if you search for them. Might need to use an actual search engine though since you can't search for the term "player" on this forum (because it's too popular a term).
__________________

Last edited by fysiks; 01-13-2024 at 17:10.
fysiks is offline
samobiezny133
Junior Member
Join Date: Jan 2024
Old 01-14-2024 , 02:12   Re: nickname changer
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
I basically do this already but specifically for players who have the default name "Player". You should be able to modify it as needed. You'll have to change the logic for preventing a name change because I only disallow "Player" but it shouldn't be that hard.

https://github.com/fysiks1/amxx-noplayername

There are other examples out there for preventing name changes if you search for them. Might need to use an actual search engine though since you can't search for the term "player" on this forum (because it's too popular a term).

Thank you very much! I'll work on your script a bit and try to adapt it to my needs.
Your help is invaluable.
Best regards and have a nice day.
samobiezny133 is offline
samobiezny133
Junior Member
Join Date: Jan 2024
Old 01-14-2024 , 02:47   Re: nickname changer
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
I basically do this already but specifically for players who have the default name "Player". You should be able to modify it as needed. You'll have to change the logic for preventing a name change because I only disallow "Player" but it shouldn't be that hard.

https://github.com/fysiks1/amxx-noplayername

There are other examples out there for preventing name changes if you search for them. Might need to use an actual search engine though since you can't search for the term "player" on this forum (because it's too popular a term).
I trimmed the script a bit. I just need each nickname to be replaced with one of the nicknames from the pool. I already have a plugin that stops the player from changing their nickname. Honestly, I don't know anything about programming (I thought it is a little easier and I think my brain is probably too old to learn it, haha). I need this plugin for a private server where I play with friends from my student days. Could you edit the script for me to change the nickname for everyone, regardless of whether their name is player or not? I would be very grateful.

Script modified by me : https://pastebin.com/9QpqkewJ

Last edited by samobiezny133; 01-14-2024 at 03:33.
samobiezny133 is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 01-14-2024 , 13:42   Re: nickname changer
Reply With Quote #5

you are talking about changing or adding a nickname to the existing name...

Code:
Player connecting... (nickname) Player connected.

or

Code:
Player connecting... nickname connected.
__________________
mlibre is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-14-2024 , 18:46   Re: nickname changer
Reply With Quote #6

Quote:
Originally Posted by samobiezny133 View Post
I already have a plugin that stops the player from changing their nickname.
That will probably conflict with a plugin designed to change names. I think both functions must be in the same plugin so that the two functionalities don't conflict.
__________________
fysiks is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 01-14-2024 , 20:59   Re: nickname changer
Reply With Quote #7

another detail is to avoid duplicates
__________________
mlibre is offline
samobiezny133
Junior Member
Join Date: Jan 2024
Old 01-15-2024 , 10:10   Re: nickname changer
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
That will probably conflict with a plugin designed to change names. I think both functions must be in the same plugin so that the two functionalities don't conflict.

In this case, I will disable this plugin so that it does not conflict with the nickname change plugin.
samobiezny133 is offline
samobiezny133
Junior Member
Join Date: Jan 2024
Old 01-15-2024 , 10:13   Re: nickname changer
Reply With Quote #9

Quote:
Originally Posted by mlibre View Post
you are talking about changing or adding a nickname to the existing name...

Code:
Player connecting... (nickname) Player connected.

or

Code:
Player connecting... nickname connected.
I mean completely changing the nickname of each connected player
samobiezny133 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-16-2024 , 02:31   Re: nickname changer
Reply With Quote #10

Ok, so here is this plugin working based on my understanding of your request.
Attached Files
File Type: sma Get Plugin or Get Source (force_player_name.sma - 13 views - 6.8 KB)
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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