Monthly Target: $400 Donations: $126
 31% 

Country Nick Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
AeN0
Junior Member
Join Date: Nov 2008
Location: France
Plugin ID:
706
Plugin Version:
1.1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    183 
    Plugin Description:
    Add country flag of the player in his/her nickname
    Old 01-05-2009 , 13:02   Country Nick Plugin
    Reply With Quote #1

    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
    Attached Files
    File Type: sp Get Plugin or Get Source (countrynick.sp - 12024 views - 3.1 KB)
    File Type: txt countrynick.phrases.txt (300 Bytes, 6883 views)
    File Type: zip translations.zip (1.1 KB, 6027 views)

    Last edited by AeN0; 03-28-2009 at 21:10. Reason: windows servers
    AeN0 is offline
    CapsAdmin
    Junior Member
    Join Date: Sep 2007
    Location: Norway
    Old 01-05-2009 , 14:22   Re: Country Nick Plugin
    Reply With Quote #2

    Plugin failed to compile.
    CapsAdmin is offline
    AeN0
    Junior Member
    Join Date: Nov 2008
    Location: France
    Old 01-05-2009 , 14:23   Re: Country Nick Plugin
    Reply With Quote #3

    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.

    Last edited by AeN0; 01-05-2009 at 14:29.
    AeN0 is offline
    JazzCP
    Member
    Join Date: Aug 2008
    Old 01-06-2009 , 15:06   Re: Country Nick Plugin
    Reply With Quote #4

    This is actually a pretty good plugin. We now use this as an alternative to CAnnounce. Good job with this
    JazzCP is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 01-06-2009 , 15:35   Re: Country Nick Plugin
    Reply With Quote #5

    Quote:
    Originally Posted by AeN0 View Post
    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.
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    AeN0
    Junior Member
    Join Date: Nov 2008
    Location: France
    Old 01-06-2009 , 17:37   Re: Country Nick Plugin
    Reply With Quote #6

    Thanks for the tip. 1.1 released.
    AeN0 is offline
    Zuko
    SourceMod Donor
    Join Date: Sep 2006
    Location: Poland
    Old 01-06-2009 , 20:17   Re: Country Nick Plugin
    Reply With Quote #7

    Polish translation, utf-8
    Attached Files
    File Type: txt countrynick.phrases.txt (397 Bytes, 600 views)
    __________________
    Zuko is offline
    Send a message via ICQ to Zuko
    DeaD_EyE82
    SourceMod Donor
    Join Date: Jan 2006
    Location: Germany
    Old 01-08-2009 , 11:52   Re: Country Nick Plugin
    Reply With Quote #8

    german translation, utf-8
    Attached Files
    File Type: txt countrynick.phrases.txt (227 Bytes, 557 views)
    __________________
    German Support for HL2-Servers:

    sourceserver.info

    Last edited by DeaD_EyE82; 01-12-2009 at 00:43.
    DeaD_EyE82 is offline
    Send a message via ICQ to DeaD_EyE82
    AeN0
    Junior Member
    Join Date: Nov 2008
    Location: France
    Old 01-08-2009 , 15:01   Re: Country Nick Plugin
    Reply With Quote #9

    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 ?

    Last edited by AeN0; 01-08-2009 at 15:16.
    AeN0 is offline
    DeaD_EyE82
    SourceMod Donor
    Join Date: Jan 2006
    Location: Germany
    Old 01-12-2009 , 00:44   Re: Country Nick Plugin
    Reply With Quote #10

    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.
    __________________
    German Support for HL2-Servers:

    sourceserver.info
    DeaD_EyE82 is offline
    Send a message via ICQ to DeaD_EyE82
    Reply


    Thread Tools
    Display Modes

    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 02:16.


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