[ANY] Country tag

Release your plugins here!
existenz
Senior Member
Posts: 111
Joined: Thu Feb 09, 2017 3:33 pm
Location: France
Contact:

[ANY] Country tag

Postby existenz » Tue May 16, 2017 5:25 pm

Hey !



Configuration :
If your game support clan tag :
    1 - Remove player tag
    0 - Don't remove player tag

    1 - Enable country tag
    0 - Disable country tag

Announce message :
    1 - Enable country announce on connection
    0 - Disable country announce on connection
    1 - Enable country announce with steamid showing
    0 - Disable country announce with steamid showing


This new plugin allows you to display an ad to connect players with his country and s
    teamid. If the game support clan tag like Csgo and Css set country in clan tag.

    I have only test this plugin on Csgo. Tell me if it's not working on other games.
    Fill free to send pull request on my git to improve this plugin :)

    Sincerly Existenz.
    Last edited by existenz on Thu May 18, 2017 6:42 pm, edited 2 times in total.
    User avatar
    Painkiller
    Senior Member
    Posts: 265
    Joined: Sun Mar 01, 2015 8:09 am
    Contact:

    Re: [ANY] Country tag

    Postby Painkiller » Wed May 17, 2017 8:39 am

    Hello Existenz,

    I have tested it loads completely normal with Half Life 2 Deathmatch.

    But I see nothing in the chat or in the clan tag.
    User avatar
    Painkiller
    Senior Member
    Posts: 265
    Joined: Sun Mar 01, 2015 8:09 am
    Contact:

    Re: [ANY] Country tag

    Postby Painkiller » Thu May 18, 2017 8:49 am

    It is curious, it just does not indicate anything.

    It loads normally, no errors.
    User avatar
    satoon101
    Project Leader
    Posts: 2381
    Joined: Sat Jul 07, 2012 1:59 am

    Re: [ANY] Country tag

    Postby satoon101 » Thu May 18, 2017 12:32 pm

    Have you tried the latest version? I think Ayuto's pull request might have fixed it so it could work on HL2:DM.

    *Edit: also, HL2:DM doesn't have clan tags, so that would have no effect anyway.
    Image
    existenz
    Senior Member
    Posts: 111
    Joined: Thu Feb 09, 2017 3:33 pm
    Location: France
    Contact:

    Re: [ANY] Country tag

    Postby existenz » Thu May 18, 2017 12:33 pm

    Yes i have ask him to try but it doesn't work ... It's really weird
    User avatar
    satoon101
    Project Leader
    Posts: 2381
    Joined: Sat Jul 07, 2012 1:59 am

    Re: [ANY] Country tag

    Postby satoon101 » Thu May 18, 2017 12:54 pm

    There are 2 reasons I can think of.

    First, this should only be sending to other players, and not the joining player himself (which makes the most sense anyway). So, you'll have to test with other people joining the server.

    Second, the player's address is not found in geoip2's database. I am testing on a local server, and so my IP is my LAN IP, and it encounters the AddressNotFoundError.
    Image
    User avatar
    Kill
    Member
    Posts: 80
    Joined: Wed Aug 31, 2016 10:05 pm

    Re: [ANY] Country tag

    Postby Kill » Thu May 18, 2017 1:23 pm

    satoon101 wrote:There are 2 reasons I can think of.

    First, this should only be sending to other players, and not the joining player himself (which makes the most sense anyway). So, you'll have to test with other people joining the server.

    Second, the player's address is not found in geoip2's database. I am testing on a local server, and so my IP is my LAN IP, and it encounters the AddressNotFoundError.



    If You use the public IP to connect, it will work. (Tested it myself)
    User avatar
    satoon101
    Project Leader
    Posts: 2381
    Joined: Sat Jul 07, 2012 1:59 am

    Re: [ANY] Country tag

    Postby satoon101 » Thu May 18, 2017 4:33 pm

    Ok, thank you. I'll test that later tonight myself. But, I just mean that maybe the users that Painkiller is testing with don't have IPs that are known in geoip2.
    Image
    User avatar
    Painkiller
    Senior Member
    Posts: 265
    Joined: Sun Mar 01, 2015 8:09 am
    Contact:

    Re: [ANY] Country tag

    Postby Painkiller » Thu May 18, 2017 6:27 pm

    Hi i have test it. Its work.
    Show me this in chat: ~ user [Linux] ([U:1:10701000]) connected from Germany.

    What makes this wave sign there?
    existenz
    Senior Member
    Posts: 111
    Joined: Thu Feb 09, 2017 3:33 pm
    Location: France
    Contact:

    Re: [ANY] Country tag

    Postby existenz » Thu May 18, 2017 6:31 pm

    The '~' is just char that i have add to SayText2 you can remove it here : https://github.com/VenomzGaming/Sp-Coun ... tag.ini#L2
    User avatar
    satoon101
    Project Leader
    Posts: 2381
    Joined: Sat Jul 07, 2012 1:59 am

    Re: [ANY] Country tag

    Postby satoon101 » Thu May 18, 2017 7:30 pm

    Don't change it in that file directly. If you ever update the plugin on your server, you will overwrite this file. When you first loaded the plugin, it should have created a country_tag_server.ini file in that same directory. The translations system is setup so that it will utilize any overridden translations from the server specific file. So, if you want to change the messages, copy the contents of the country_tag.ini file into the country_tag_server.ini file and make the changes there.
    Image
    existenz
    Senior Member
    Posts: 111
    Joined: Thu Feb 09, 2017 3:33 pm
    Location: France
    Contact:

    Re: [ANY] Country tag

    Postby existenz » Thu May 18, 2017 7:32 pm

    Thanks ! I don't know that :D
    User avatar
    Painkiller
    Senior Member
    Posts: 265
    Joined: Sun Mar 01, 2015 8:09 am
    Contact:

    Re: [ANY] Country tag

    Postby Painkiller » Thu May 18, 2017 7:40 pm

    Ok now its work all. Thanks mates.

    But i have little error:

    Code: Select all

    [SP] Loading plugin 'geoip'...

    [SP] Caught an Exception:
    Traceback (most recent call last):
      File "../addons/source-python/packages/source-python/plugins/command.py", line 162, in load_plugin
        plugin = self.manager.load(plugin_name)
      File "../addons/source-python/packages/source-python/plugins/manager.py", line 193, in load
        plugin._load()
      File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
        self.module = import_module(self.import_name)
      File "../addons/source-python/plugins/geoip/geoip.py", line 11, in <module>
        zip_file = ZipFile(BytesIO(data))
      File "../addons/source-python/Python3/zipfile.py", line 1026, in __init__
        self._RealGetContents()
      File "../addons/source-python/Python3/zipfile.py", line 1093, in _RealGetContents
        raise BadZipFile("File is not a zip file")

    zipfile.BadZipFile: File is not a zip file


    I installed it again but it always comes back.
    But does not seem to disturb but an annoying log in the console
    User avatar
    satoon101
    Project Leader
    Posts: 2381
    Joined: Sat Jul 07, 2012 1:59 am

    Re: [ANY] Country tag

    Postby satoon101 » Thu May 18, 2017 8:23 pm

    The code in that error has nothing to do with this plugin.
    Image
    User avatar
    Painkiller
    Senior Member
    Posts: 265
    Joined: Sun Mar 01, 2015 8:09 am
    Contact:

    Re: [ANY] Country tag

    Postby Painkiller » Thu May 18, 2017 8:56 pm

    I thought about geoip

    Edit: aar i find ... :cool:

    Edit2: For other color codes in the country_tag.ini
    It also work hax colors.

    http://www.farb-tabelle.de/de/farbtabelle.htm

    Code: Select all

    [Connect Announce]
    en = " \x0700FF00{name} \x07FFFF00connected from \x0700FF00{country}."
    fr = " \x0700FF00{name} \x07FFFF00vient de \x0700FF00{country}."

    [Connect Announce Steamid]
    en = " \x0700FF00{name} \x07FF0000({steamid}) \x07FFFF00connected from \x0700FF00{country}."
    fr = " \x0700FF00{name} \x07FF0000({steamid}) \x07FFFF00vient de \x0700FF00{country}."

    Return to “Plugin Releases”

    Who is online

    Users browsing this forum: No registered users and 1 guest