Raised This Month: $7 Target: $400
 1% 

Country Nick Plugin


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

    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
    Attached Files
    File Type: txt countrynick.phrases.txt (300 Bytes, 9482 views)
    File Type: zip translations.zip (1.1 KB, 8201 views)
    File Type: sp Get Plugin or Get Source (countrynick 1.2.3_fix.sp - 1042 views - 4.7 KB)

    Last edited by AeN0; 07-29-2021 at 15:50. Reason: 1.2.3
    AeN0 is offline
    CapsAdmin
    Junior Member
    Join Date: Sep 2007
    Location: Norway
    Old 01-05-2009 , 13:22   Re: Country Nick Plugin
    Reply With Quote #2

    Plugin failed to compile.
    CapsAdmin is offline
    AeN0
    Junior Member
    Join Date: Nov 2008
    Old 01-05-2009 , 13: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 13:29.
    AeN0 is offline
    JazzCP
    Member
    Join Date: Aug 2008
    Old 01-06-2009 , 14: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 , 14: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
    Old 01-06-2009 , 16: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 , 19:17   Re: Country Nick Plugin
    Reply With Quote #7

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

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

    sourceserver.info

    Last edited by DeaD_EyE82; 01-11-2009 at 23:43.
    DeaD_EyE82 is offline
    Send a message via ICQ to DeaD_EyE82
    AeN0
    Junior Member
    Join Date: Nov 2008
    Old 01-08-2009 , 14: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 14:16.
    AeN0 is offline
    DeaD_EyE82
    AlliedModders Donor
    Join Date: Jan 2006
    Location: Germany
    Old 01-11-2009 , 23: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:30.


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