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.

AeN0 01-15-2009 14:16

Re: Country Nick Plugin
 
Update : plugin not working anymore on win32 servers with L4D. SetInfoClient crashes srcds.exe.

AeN0 01-23-2009 13:06

Re: Country Nick Plugin
 
The plugin should work again on Windows L4D servers with the latest 1.2 snapshot.

Big Myke 01-23-2009 14:01

Re: Country Nick Plugin
 
Hmm, the server seems to crash with your new update. I had to remove the plugin for the team being.

AeN0 01-23-2009 15:05

Re: Country Nick Plugin
 
Quote:

Originally Posted by Big Myke (Post 748783)
Hmm, the server seems to crash with your new update. I had to remove the plugin for the team being.

I didn't update my plugin since 1.1, or ... are you upgrading from 1.0 ?

Big Myke 02-05-2009 15:27

Re: Country Nick Plugin
 
Pluggin works well so far now. I tested it again. Hopefully you'll continue to work on this pluggin.

AeN0 02-05-2009 15:37

Re: Country Nick Plugin
 
Quote:

Originally Posted by Big Myke (Post 756341)
Pluggin works well so far now. I tested it again. Hopefully you'll continue to work on this pluggin.

Development is slowed down but don't worry, I keep watching this thread :).

Big Myke 02-05-2009 15:48

Re: Country Nick Plugin
 
when you mentioned in the release notes you said you made flags next to their names. I was expecting pictures of actual flags haha instead of just [US] Big Myke for example.

Big Myke 02-05-2009 18:37

Re: Country Nick Plugin
 
After that I finally got to test it. I decided to remove it. I don't like that there's too much messages going on when someone connects. it says that Player had changed his name to [US]<playername> everytime. thats just too much useless bloat. The pluggin works great though. Good job.

blooddog_90 02-06-2009 10:23

Re: Country Nick Plugin
 
Thank you for this Plugin,

but what do I have to change if I want it like that way:

<name><country> ?

Like:

Gamer[UK]

toxic4u 02-06-2009 13:25

Re: Country Nick Plugin
 
plugin says, that it is loaded and running, but I don't get messages on server.

Any idea?

Thanks
Toxic

justincase 02-17-2009 01:12

Re: Country Nick Plugin
 
Quote:

Originally Posted by blooddog_90 (Post 756834)
Thank you for this Plugin,
but what do I have to change if I want it like that way:
<name><country> ?
Like:
Gamer[UK]

you can just edit the plugin source code and then compile it) i did so and have players like (UK)Gamer on my server.

Quote:

Originally Posted by toxic4u (Post 756913)
plugin says, that it is loaded and running, but I don't get messages on server.
Any idea?
Thanks
Toxic

check your sm error log files

eric0279 02-23-2009 16:55

Re: Country Nick Plugin
 
Hello,

Quote:

local variable name shadows a variable at a preceding level
thanks for fix please

AeN0 02-23-2009 17:56

Re: Country Nick Plugin
 
Where did you get that error ? (sm log ? compile time ?)

eric0279 02-23-2009 18:23

Re: Country Nick Plugin
 
Quote:

compile time
Yes and I don't modifiy this file.

AeN0 02-23-2009 18:49

Re: Country Nick Plugin
 
Fixed. 1.1.1 out. Thanks (weird, I didn't notice that warning :oops:).

eric0279 02-23-2009 19:09

Re: Country Nick Plugin
 
thanks

waertf 02-23-2009 21:26

Re: Country Nick Plugin
 
i got the error msg
Quote:

L 02/24/2009 - 10:22:39: Info (map "l4d_vs_farm01_hilltop") (file "errors_20090224.log")
L 02/24/2009 - 10:22:39: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/24/2009 - 10:22:39: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/24/2009 - 10:22:39: [SM] [0] Line 57, /home/groups/sourcemod/upload_tmp/phpqDgj7V.sp::OnClientPutInServer()
my sourcemod version
Quote:

SourceMod Version Information:
SourceMod Version: 1.2.0-dev
SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.2.0-dev)
SourcePawn API: v1 = 4, v2 = 3
Compiled on: Feb 19 2009 02:46:21
Build ID: 2594:41247f508971-dev

waertf 02-23-2009 22:12

Re: Country Nick Plugin
 
Quote:

Originally Posted by waertf (Post 767742)
i got the error msg

my sourcemod version

there is the same issue in this version
Quote:

Build ID: 2599:e639923af7dd-dev

AeN0 02-24-2009 11:24

Re: Country Nick Plugin
 
Can't reproduce this bug with the same SM snapshot. Have you done a clean install ? (delete sourcemod dir and reinstall everything ?).

Connected as "will(fr)"
Appeared as "[--]will (fr)"
Changed name to "fzg"
Appeared as "[--]fzg"

Code:

Server waking up from hibernation
Client "will (fr)" connected (192.168.1.106:27005).
L 02/24/2009 - 17:17:29: [countrynick.smx] [Country Nick] Warning : [--]will (fr) uses 192.168.1.106 that is not listed in GEOIP database
Dropped [--]fzg from server (Disconnect by user.)
sm version
 SourceMod Version Information:
    SourceMod Version: 1.2.0-dev
    SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.2.0-dev)
    SourcePawn API: v1 = 4, v2 = 3
    Compiled on: Feb 22 2009 10:26:51
    Build ID: 2599:e639923af7dd-dev
    http://www.sourcemod.net/


waertf 02-24-2009 12:16

Re: Country Nick Plugin
 
i delete the folders:addon、cfg/sourcemod
then intall sourcemod and metamod in latest 、 clean version and your plugin only.
But the issue still exist.
Do the function block from my firewall?

AeN0 02-24-2009 12:23

Re: Country Nick Plugin
 
This plugin does not use an external tool to get the country. It uses the integrated GEOIP database in Sourcemod so your firewall should not interfere with the plugin.

waertf 02-24-2009 12:58

Re: Country Nick Plugin
 
I found the problem maybe due to not clean l4d data.
Let me double check

waertf 02-24-2009 13:22

Re: Country Nick Plugin
 
i fount that this issue happen only on the server was created by Hlds tool.

AeN0 02-24-2009 13:41

Re: Country Nick Plugin
 
Quote:

Originally Posted by waertf (Post 768134)
i fount that this issue happen only on the server was created by Hlds tool.

You mean windows servers ?

waertf 02-24-2009 14:32

Re: Country Nick Plugin
 
yes,but server was created by steam tool the plugin is ok

Kuaktus 02-25-2009 16:23

Re: Country Nick Plugin
 
L 02/25/2009 - 23:06:19: SourceMod error session started
L 02/25/2009 - 23:06:19: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:06:19: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:06:19: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:06:19: [SM] [0] Line 57, /home/groups/alliedmodders/forums/files/4/4/4/4/2/35552.attach::OnClientPutInServer()
L 02/25/2009 - 23:08:28: Error log file session closed.
L 02/25/2009 - 23:09:31: SourceMod error session started
L 02/25/2009 - 23:09:31: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:09:31: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:09:31: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:09:31: [SM] [0] Line 57, /home/groups/alliedmodders/forums/files/4/4/4/4/2/35552.attach::OnClientPutInServer()
L 02/25/2009 - 23:12:07: Error log file session closed.
L 02/25/2009 - 23:13:22: SourceMod error session started
L 02/25/2009 - 23:13:22: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:13:22: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:13:22: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:13:22: [SM] [0] Line 57, countrynick.sp::OnClientPutInServer()

AeN0 02-25-2009 17:36

Re: Country Nick Plugin
 
Quote:

Originally Posted by Kuaktus (Post 769005)
L 02/25/2009 - 23:06:19: SourceMod error session started
L 02/25/2009 - 23:06:19: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:06:19: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:06:19: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:06:19: [SM] [0] Line 57, /home/groups/alliedmodders/forums/files/4/4/4/4/2/35552.attach::OnClientPutInServer()
L 02/25/2009 - 23:08:28: Error log file session closed.
L 02/25/2009 - 23:09:31: SourceMod error session started
L 02/25/2009 - 23:09:31: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:09:31: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:09:31: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:09:31: [SM] [0] Line 57, /home/groups/alliedmodders/forums/files/4/4/4/4/2/35552.attach::OnClientPutInServer()
L 02/25/2009 - 23:12:07: Error log file session closed.
L 02/25/2009 - 23:13:22: SourceMod error session started
L 02/25/2009 - 23:13:22: Info (map "l4d_vs_hospital01_apartment") (file "errors_20090225.log")
L 02/25/2009 - 23:13:22: [SM] Native "SetClientInfo" reported: IServer interface not supported, file a bug report.
L 02/25/2009 - 23:13:22: [SM] Displaying call stack trace for plugin "countrynick.smx":
L 02/25/2009 - 23:13:22: [SM] [0] Line 57, countrynick.sp::OnClientPutInServer()

Windows server ? Anyway I can't fix this problem. It's up to Sourcemod team.

waertf 02-26-2009 00:09

Re: Country Nick Plugin
 
would u pls add this bug to update this post?
thx

Kuaktus 02-26-2009 09:54

Re: Country Nick Plugin
 
Quote:

Originally Posted by AeN0 (Post 769049)
Windows server ? Anyway I can't fix this problem. It's up to Sourcemod team.

Yes, so. It is a pity, so there would be a good alternative Cannounce

eric0279 02-26-2009 17:54

Re: Country Nick Plugin
 
Hello,

I have a error in the console to my server dedicated :
[IMG]http://img22.**************/img22/7545/pasdenom.th.jpg[/IMG]

sm plugins list :
Quote:

Listing 58 plugins:
01 "Admin File Reader" (1.1.0) by AlliedModders LLC
02 "Admin Help" (1.1.0) by AlliedModders LLC
03 "Admin List" (1.2) by Fredd
04 "Admin Menu" (1.1.0) by AlliedModders LLC
05 "Advanced c4 Countdown Timer" (1.4.1) by dalto
06 "Advertisements" (0.5.5) by Tsunami
07 "AFK Manager" (2.6) by Liam
08 "Anti-Flood" (1.1.0) by AlliedModders LLC
09 "Anti-Reconnect" (1.0.2) by exvel
10 "Anti-TK" (1.0.6) by Rothgar
11 "Basic Chat" (1.1.0) by AlliedModders LLC
12 "Basic Comm Control" (1.1.0) by AlliedModders LLC
13 "Basic Commands" (1.1.0) by AlliedModders LLC
14 "Basic Info Triggers" (1.1.0) by AlliedModders LLC
15 "Basic Votes" (1.1.0) by AlliedModders LLC
16 "VBAC" (3.3) by MoggieX
17 "Bounty" (1.0.9.0) by Shane A. ^BuGs^ Froebel, FlyingMongoose, and stoic
18 "Chat Filter" (0.3) by chundo
19 "Client Preferences" (1.1.0) by AlliedModders LLC
20 "Country Nick Plugin" (1.1.1) by Antoine LIBERT aka AeN0
21 "Goremod" (4.0.1) by Joe 'Pinkfairie' Maley
22 "Custom Votes" (0.5.6) by chundo
23 "Fun Commands" (1.1.0) by AlliedModders LLC
24 "Fun Votes" (1.1.0) by AlliedModders LLC
25 "IRC Relay - Admin Commands Module" (2.1.0) by Olly
26 "IRC Relay - Auth Module" (2.1.0) by Olly
27 "IRC Relay - Bacon" (2.1.0) by Olly
28 "IRC Relay - Base Commands" (2.1.0) by Olly
29 "IRC Relay - Chat Relay Module" (2.1.0) by Olly
30 "IRC Relay - Game Players" (2.1.0) by Olly
31 "IRC Relay - Relay Module" (2.1.0) by Olly
32 "IRC Relay - Game Info Module" (2.1.0) by Olly
33 "IRC Relay - Core Plugin" (2.1.0) by Olly
34 "IRC Relay - Steam Community" (2.1.0) by Olly
35 "Laser Tag" (1.0) by Chocolate and Cheese
36 "Map Rate" (0.10) by Ryan "FLOOR_MASTER" Mannion
37 "MySQL Bans" (2.0) by Team MX | MoggieX
38 "Nextmap" (1.1.0) by AlliedModders LLC
39 "No Block" (1.0.0.0) by sslice
40 "SlapSlay Commands" (1.1.0) by AlliedModders LLC
41 "PsychoStats rank`n`top" (0.2) by O!KAK
42 "Quake Sounds" (1.8) by dalto
43 "RateChecker" (0.3be) by pRED*, mod. by BehaartesEtwas
44 "Reserved Slots" (1.1.0) by AlliedModders LLC
45 "Weapon Restrictions" (3.0.2) by Liam
46 "Server Crontab" (1.0.1.0) by dubbeh
47 "Server Crontab Module" (1.0.1.0) by dubbeh
48 "Show Damage" (1.0.1) by exvel
49 "Menu Based Rules" (1.5.1) by XARiUS
50 "Pack SourceMod Only & Plugis Fun FR" (1.0) by ALpha
51 "PlayersList" (0.3) by O!KAK
52 "SM Super Commands" (0.60) by pRED*
53 "SM Super Menu" (0.5) by pRED*
54 "SourceBans" (1.4.1) by InterWave Studios Development Team
55 "Team Balance" (2.2.2) by dalto
56 "Team Bets" (1.4) by ferret
57 "Teamspeak join command" (1.2) by Berni
58 "VAC Status Checker" (1.1.0) by Stevo.TVR
sm exts list :
Quote:

[01] CS:S Tools (1.1.0): CS:S extended functionality
[02] BinTools (1.1.0): Low-level C/C++ Calling API
[03] Top Menus (1.1.0): Creates sorted nested menus
[04] SDK Tools (1.1.0): Source SDK Tools
[05] Client Preferences (1.1.0-svn): Saves client preference settings
[06] SQLite (1.1.0): SQLite Driver
[07] GeoIP (1.1.0): Geographical IP information
[08] Socket (2.4.0): Socket extension for SourceMod
[09] Regex (1.1.0): Provides regex natives for plugins
[10] MySQL-DBI (1.1.0): MySQL driver implementation for DBI
SourceMod 1.1.2 and metamod source 1.7.1

Result after compilation :
Quote:

Your plugin successfully compiled!
Use the link below to download your plugin. It will be valid for ten minutes.

http://www.sourcemod.net/compiler.php?go=dl&id=53744SourcePawn Compiler 1.1.0
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

Header size: 2348 bytes
Code size: 1740 bytes
Data size: 620 bytes
Stack/heap size: 16384 bytes; Total requirements: 21092 bytes

53740 successful compiles to date.
39648 failed compiles to date.


All times are GMT -4. The time now is 08:30.

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