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 12:02

Country Nick Plugin
 
6 Attachment(s)
The plugin is maintained here https://forums.alliedmods.net/showth...19#post2737619

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


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

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 13:22

Re: Country Nick Plugin
 
Plugin failed to compile.

AeN0 01-05-2009 13: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 14: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 14: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 16:37

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

Zuko 01-06-2009 19:17

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

DeaD_EyE82 01-08-2009 10:52

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

AeN0 01-08-2009 14: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-11-2009 23: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 06:53.

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