Raised This Month: $51 Target: $400
 12% 

Nametag 1.51


Post New Thread Reply   
 
Thread Tools Display Modes
Author
makerpopo
Junior Member
Join Date: Feb 2010
Plugin ID:
2115
Plugin Version:
1.51
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Nametag plugin, supports SQL
    Old 12-05-2010 , 13:03   Nametag 1.51
    Reply With Quote #1

    Description
    This is my first "working" plugin. It tags players with MySQL support.
    So, clients can use their tag without setting it every time they join a server, even on another server!
    (If it's running this plugin with same database setting, well.)

    This plugin supports translation, and includes only English and Korean translations. Oh, and sorry for my poor English.

    Preview, with Korean translation.
    [IMG]http://img254.**************/img254/9273/nametag0.png[/IMG]
    Credits
    Cvars
    Quote:
    • sm_nametag_version "1.51"
      Nametag Version.
    • sm_nametag_enable "1"
      - 1: Enable nametag.
      - 0: Disable nametag.
    • sm_nametag_admin "0"
      - 1: Only admins (with chat flag) can use nametag menu.
      - 0: Everyone can use nametag menu.
    • sm_nametag_admin_immunity "1"
      - 1: Admins (with chat flag) are not affected by sm_settag.
      - 0: Everyone is affected by sm_settag.
    • sm_nametag_chatmode "1"
      - 1: Anyone can use their own nametag if they have it on database.
      - 0: Only Admins (with chat flag) can use their own nametag.
    Commands
    Quote:
    • sm_nametag
      Opens nametag menu.
    • sm_cleartag
      Clears one's nametag.
    • sm_settag "target" "tag" (without quotes), requires chat/root flag
      Sets a target's nametag. saying /settag "target" "tag" (without quotes) will work the same.

      If only one argument is excuted, it will set one's tag as blank.

      Supported color tags: {default}, {green}, {olive}, {teamcolor}
    Installation
    1. Add/Modify followings to addons/sourcemod/configs/databases.cfg
      Code:
      "nametag"
      {
      	"driver"		"mysql"
      	"host"			"localhost"
      	"database"		"nametag"
      	"user"			"user"
      	"pass"			"password"
      }
      You don't have to set database.cfg up. If you don't, it will run on SQLite.
    2. Download and Install SteamTools. This plugin requires it to run.
    3. Download zip file, extract it to sourcemod directory.
    4. Modify configs/nametag.cfg as you want.
      Code:
      "Nametag"
      {
          "Scout"        // Nametag's name that will be displayed on menu.
          {
              "achievement"		"TF_SCOUT_ACHIEVE_PROGRESS3"        // Achievement. You can find it on tf_english.txt.
              "nametag"				"{default}Scout"        // Nametag, also supports color tags.
              "description"			"Scout Milestone 3"        // Name of the achievement.
          }
      }
    5. Config file will be automatically generated on cfg/sourcemod/nametag.cfg once you run the server.
    Changelog
    1.0
    • Initial Release
    1.1 - This is (kinda) big update. And since I'm pretty skilless, I think this update will screw something up.
    • Added cvars: sm_nametag_enable, sm_nametag_admin_immunity, sm_nametag_chatmode
    • sm_settag is now sm_nametag.
    • Added command: sm_settag. Now you can award a player with nametag!
    • Added SQLite support
    • Minor fixes
    1.5 Beta
    • Added TF2 achievement supports.
    • sm_nametag now opens nametag menu. Admins still can set their own with 'sm_settag @me (tag)'.
    • Added command: sm_cleartag.
    • Version 1.1 is still attached for games aside from TF2.
    1.5 Beta 2
    • Added ADMFLAG_ROOT check. Now root admins can use sm_settag too.
    • Added supports for no-achievement-required nametag. Like:
      Code:
      "Noob"
          {
              "nametag"				"{olive}Noob"
          }
    • Minor fixes
    1.5 Beta 3 - It's untested, but I hope it to work.
    • If a tag is cleared, It will be cleared from SQL server too, not only from server.
    • Hopefully fixed clients being tagged randomly.
    1.51
    • If a tag is cleared, It will be cleared from SQL server too, not only from server. REALLY.
    • Hopefully fixed clients being tagged randomly, again. But still hopefully.
    Attached Files
    File Type: zip nametag_1.1.zip (15.4 KB, 1474 views)
    File Type: zip nametag_1.51.zip (22.2 KB, 5002 views)
    File Type: sp Get Plugin or Get Source (nametag.sp - 1741 views - 20.3 KB)

    Last edited by makerpopo; 12-23-2010 at 05:33. Reason: 1.51 Update
    makerpopo is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 12-05-2010 , 14:12   Re: Nametag 1.0 (MySQL Support)
    Reply With Quote #2

    Minor bug: there's no guarantee that a client will have a SteamID by the time "OnClientPutInServer" is called. "OnClientPostAdminCheck" would be a better option. Otherwise, looks pretty good
    __________________
    Scone is offline
    Matheus28
    Senior Member
    Join Date: Aug 2009
    Old 12-05-2010 , 18:44   Re: Nametag 1.0 (MySQL Support)
    Reply With Quote #3

    Make admins be able to set a player tag.

    Use CRemoveTags to escape the player name (around line 202)

    Also, make it use SQLite if there is no "nametag" config. (Use SQL_CheckConfig)

    Last edited by Matheus28; 12-05-2010 at 18:47.
    Matheus28 is offline
    Skyrider
    AMX Mod X Beta Tester
    Join Date: May 2005
    Location: Netherlands
    Old 12-12-2010 , 10:24   Re: Nametag 1.5 Beta: Now with achievement supports
    Reply With Quote #4

    Possible that the admin can give people a specific name tag? That he'll keep forever as long the plugin exists (and his name) in the database? This is actually very good to use in trade servers, to tag people who are "trusted".

    Also, keep getting this:
    Quote:
    * You need to achieve Scout Milestone 3 to use this nametag.
    Same error for the soldier, medic, etc as well.. While I already have milestone 3.

    There's also something wrong with the sm_settag command ingame.. gives me the error:
    Quote:
    * Only admins can access to this command
    While I'm logged in as root. Same with the /settag "target" "tag" command.

    And another thing :p
    Quote:
    * You need to achieve Trusted Trader to use this nametag.
    Why do I get this when I use:
    Quote:
    "Trusted"
    {
    "achievement" "TF_MEDIC_ACHIEVE_PROGRESS3"
    "nametag" "{green}Trusted"
    "description" "Trusted Trader"
    }
    Shouldn't it grab the TF_MEDIC_ACHIEVE_PROGRESS3 achievement instead? How do I set it so no achievement is needed?
    __________________

    Last edited by Skyrider; 12-12-2010 at 10:44.
    Skyrider is offline
    Send a message via AIM to Skyrider Send a message via MSN to Skyrider Send a message via Yahoo to Skyrider
    makerpopo
    Junior Member
    Join Date: Feb 2010
    Old 12-12-2010 , 13:15   Re: Nametag 1.5 Beta: Now with achievement supports
    Reply With Quote #5

    Quote:
    Originally Posted by FF|Skyrider View Post
    Also, keep getting this:

    Same error for the soldier, medic, etc as well.. While I already have milestone 3.
    I believe it's bug of Steamtools. I solved this by renaming orangebox/bin/steamclient.dll to something else. But if I try to get a client's stat more than once, it just spews some error. So achievements achieved while playing on the server are not checked, though there's code for this now.

    About root flag, I forgot about that too long. Added.

    Quote:
    Originally Posted by FF|Skyrider View Post
    Shouldn't it grab the TF_MEDIC_ACHIEVE_PROGRESS3 achievement instead? How do I set it so no achievement is needed?
    "achievement" is the actual name of the achievement. It's listed on tf_english.txt(and other language files). And "description" is the displaying name of the achievement.
    I made it that way since I don't possess the ability to get displaying name(like Scout Milestone 3) from actual name(TF_SCOUT_ACHIEVE_PROGRESS3).

    About requiring no achievement. I also added that. Thanks. I hope that works well.
    makerpopo is offline
    Skyrider
    AMX Mod X Beta Tester
    Join Date: May 2005
    Location: Netherlands
    Old 12-12-2010 , 19:45   Re: Nametag 1.5 Beta 2: Now with achievement supports
    Reply With Quote #6

    Very nice plugin and thanks for the updates, thanks!
    __________________
    Skyrider is offline
    Send a message via AIM to Skyrider Send a message via MSN to Skyrider Send a message via Yahoo to Skyrider
    Skyrider
    AMX Mod X Beta Tester
    Join Date: May 2005
    Location: Netherlands
    Old 12-14-2010 , 13:59   Re: Nametag 1.5 Beta 2: Now with achievement supports
    Reply With Quote #7

    Can more colors be added? Purple, Red, Yellow etc? Would be great.
    __________________
    Skyrider is offline
    Send a message via AIM to Skyrider Send a message via MSN to Skyrider Send a message via Yahoo to Skyrider
    Matheus28
    Senior Member
    Join Date: Aug 2009
    Old 12-14-2010 , 16:04   Re: Nametag 1.5 Beta 2: Now with achievement supports
    Reply With Quote #8

    No, it's not possible.

    It's only possible to show one team color per message.

    And it's not possible to add more colors.
    Matheus28 is offline
    Skyrider
    AMX Mod X Beta Tester
    Join Date: May 2005
    Location: Netherlands
    Old 12-15-2010 , 17:22   Re: Nametag 1.5 Beta 2: Now with achievement supports
    Reply With Quote #9

    Alright, thanks. What about endings? Possible to end a color?.. EG:

    sm_settag Sky [{olive}Pimp{/olive}]

    So only pimp gets colored.

    ---

    I also noticed that some people got nametags while they never used the menu, nor I gave them the nametags.

    EDIT:
    Yup.. Got confirmation. People using the tag menu or admin setting tags to people seem to copy over to others randomly, while they never used the tag menu nor I added it for those people.

    EDIT 2:
    It seems the nametags that are being copied over to other people don't even appear to be in the SQL database, yet they have the copy nametag on them.

    EDIT 3:
    By using the sm_settag name without a value will remove their nametag and make it default, right? How ever, the name & steamId are still being saved in the SQL but without a value at the tag value. I think it should be removed rather than taking up space.
    __________________

    Last edited by Skyrider; 12-15-2010 at 21:02.
    Skyrider is offline
    Send a message via AIM to Skyrider Send a message via MSN to Skyrider Send a message via Yahoo to Skyrider
    makerpopo
    Junior Member
    Join Date: Feb 2010
    Old 12-16-2010 , 03:42   Re: Nametag 1.5 Beta 2: Now with achievement supports
    Reply With Quote #10

    Quote:
    Originally Posted by FF|Skyrider View Post
    Alright, thanks. What about endings? Possible to end a color?.. EG:

    sm_settag Sky [{olive}Pimp{/olive}]

    So only pimp gets colored.
    I don't think it is needed, and it's not made by me.
    You can use {default} or {teamcolor}. I think they're the closest to what you want.

    Quote:
    Originally Posted by FF|Skyrider View Post
    I also noticed that some people got nametags while they never used the menu, nor I gave them the nametags.
    I hopefully fixed that. Well, I, at least, tried to fix that. Though they're not tested.

    Quote:
    Originally Posted by FF|Skyrider View Post
    By using the sm_settag name without a value will remove their nametag and make it default, right? How ever, the name & steamId are still being saved in the SQL but without a value at the tag value. I think it should be removed rather than taking up space.
    I also tried to fix it. I'm not good at SQL language, and it's untested.

    About the plugin being poorly coded, please take it as me studying Sourcemod. So I can code better and better.
    makerpopo is offline
    Reply



    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 14:09.


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