AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Country Nick Plugin (https://forums.alliedmods.net/showthread.php?t=83178)

AeN0 01-05-2009 13:02

Country Nick Plugin
 
6 Attachment(s)
This plugin adds the country flag in his/her nickname and announces the player country when he/she connects to the server. This is NOT a country filter plugin.

Example :
Chat message : nickname from USA joined the game
nickname becomes [US]nickname in the scoreboard
if the country is unknown, [--]nickname

Requirements :
  • Sourcemod 1.1 (function SetClientInfo only available since 1.1)
  • GeoIP (included in Sourcemod)
Known bugs :
  • Flag is not set back when players changes his/her nickname ingame (need help on this one, I get infinite loop : hooked player_changename, when player changes name, player_changename is fired, I add the flag into the new nick and set the new nick, player_changename is fired again, etc.)
  • The plugin does not use the translation layer of soucemod. It's only two phrases so ... edit and recompile source.
  • Does not work on Windows servers (see bug 3569 : https://bugs.alliedmods.net/show_bug.cgi?id=3569 ); plugin development halted until this bug is fixed.
  • Sometime you can see the player changing his name twice ([UK]oldname => newname => [UK]newname).
  • According to some people in this thread, this plugin does not work on Windows servers. Awaiting infos...
Changelog :
  • 1.0 - Initial release
  • 1.1
    • Fixed ingame change name (thx Antithasys)
    • Added translation support
    • unknown country => "[--]nickname" instead of "nickname"
  • 1.1.1
    • Fixed warning 219 at compile time
Plan :
  • Ability to custom format the nickname
  • Cvar to disable announcer
Setup :
Put countrynick.smx in plugins and countrynick.phrases.txt in translations. The archive translations.zip contains pl and de languages at the moment.


Misc :
I couldn't found a plugin that adds the flag to the nickname so I made it. It was done for my L4D server but It should work on any other game.

I advice you to update from time to time your GEOIP database to keep the current country <=> IP up to date. The database can be downloaded here http://geolite.maxmind.com/download/...y/GeoIP.dat.gz

CapsAdmin 01-05-2009 14:22

Re: Country Nick Plugin
 
Plugin failed to compile.

AeN0 01-05-2009 14:23

Re: Country Nick Plugin
 
As I said, need 1.1. These forums do not have the 1.1 compiler nor the Soucemod website. Edit : added pre compiled version for Sourcemod 1.1.

JazzCP 01-06-2009 15:06

Re: Country Nick Plugin
 
This is actually a pretty good plugin. We now use this as an alternative to CAnnounce. Good job with this

Antithasys 01-06-2009 15:35

Re: Country Nick Plugin
 
Quote:

Originally Posted by AeN0 (Post 738756)
Known bugs :
  • Flag is not set back when players changes his/her nickname ingame (need help on this one, I get infinite loop : hooked player_changename, when player changes name, player_changename is fired, I add the flag into the new nick and set the new nick, player_changename is fired again, etc.)
  • The plugin does not use the translation layer of soucemod. It's only two phrases so ... edit and recompile source.

1. When you set the player name, it follows a certain format. (country-name) or something. So you know how it should look. So what you need to do to stop the loop is simple; check if the name is formated the way you need it, and if so, return Plugin_Continue on the name change event.

2. Adding translation support is very easy, consider doing it. If you need code examples just ask.

AeN0 01-06-2009 17:37

Re: Country Nick Plugin
 
Thanks for the tip. 1.1 released.

Zuko 01-06-2009 20:17

Re: Country Nick Plugin
 
1 Attachment(s)
Polish translation, utf-8

DeaD_EyE82 01-08-2009 11:52

Re: Country Nick Plugin
 
1 Attachment(s)
german translation, utf-8

AeN0 01-08-2009 15:01

Re: Country Nick Plugin
 
Thanks everyone for the translation files but I think they don't follow the new Sourcemod 1.1 guideline for distributing language files ...

Quote:

Distributing Language Files

As of SourceMod 1.1, there is a new preferred method of shipping translations. By default, the main translation file should only contain English phrases. Additional translations are made in separate files, under a folder named after the ISO language code in languages.cfg.
Wiki : http://wiki.alliedmods.net/Translations_(SourceMod_Scripting)#Distributi ng_Language_Files

But I will take care of the modification :) so don't bother.

Added an archive containing the translation files following the new 1.1 guideline. Can any sourcemod dev confirm this is what we should do ?

DeaD_EyE82 01-12-2009 00:44

Re: Country Nick Plugin
 
Thanks for the hint. I've updated the file in my first post. The old way works too, but the new way is easier for updating the language files.


All times are GMT -4. The time now is 21:05.

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