AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Fake Item Messages (https://forums.alliedmods.net/showthread.php?t=167139)

DarthNinja 09-11-2011 22:00

[TF2] Fake Item Messages
 
1 Attachment(s)
[TF2] Fake Item Messages
Version 1.5.0



Description:
Allows admins to print fake item found messages to chat.

For example...
http://content.screencast.com/users/...5dc/winrar.png

Now supports custom text!
http://content.screencast.com/users/...01-08_1001.png

Commands:
  • sm_fakeitem <client> <item index> [quality] [method]
    • <Client> = Client or userid of the target player
    • <Item Index> = The desired item's definition index from items_game.txt or in a better format here
    • [Quality] = Normal / Genuine / olive / Vintage / orange / Unusual / Unique / Community / Valve / Selfmade / Customized Haunted.
      Numbers will also work.
    • [Method] = Found / Craft / Trade / Buy / Uncrate / Gift / Earned / Refund / Wrapped. Numbers 0-10 also work.

      Example: "sm_fakeitem @me 99 vintage buy" would print DarthNinja has purchased: Vintage Tyrants Helm

  • sm_fakeitem2 <client> <method> <item text>
    • <Client> = Client or userid of the target player
    • <Method> = Found / Craft / Trade / Buy / Uncrate / Gift / Earned / Refund / Wrapped / Any custom text you want.
    • <Item Text> = Anything you care to think up, must be wrapped in quotes.

      Example: sm_fakeitem2 @me gift "A Banana" would print DarthNinja has received a gift: A Banana
      sm_fakeitem2 @me crate "A Fennec" would print DarthNinja has unboxed: A Fennec

      The item name will use the color of the last item found, or black if none have been found.
Cvars:
  • sm_fakeitem_version
    • Plugin version

Install Instructions:
  1. Place ItemMessages.smx into your addons/sourcemod/plugins/ folder.

Developers:
This plugin fires the item_found event. If you are hooking the event for stats tracking, you will get fake entries.
To prevent this, I've added an extra field to the event, you can use the following to detect fake items vs real items:
PHP Code:


public OnPluginStart()
{
    
HookEvent("item_found"OnItemFound);
}

public 
Action:OnItemFound(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
GetEventBool(event"isfake"))
    {
        
//Item is fake, maybe you'd want to use return here.
        
return;
    }
    
//Item isn't fake




ToDo:
  • Add support for custom names (PlayerX has found: A Pumpkin) - Done!
  • Menus for each option (this will be a huge pain)

Version History:
  • V1.1.0
    • Initial Release
  • V1.1.1
    • Added Uncrate alias for Unbox
    • Removed unneeded includes
    • Fixed a typo in "Customized"
    • Now loads Common Phrases
  • V1.2.0
    • Added Strange item quality option that I'd forgotten.
    • You can now type help or list in place of a quality or method to get a listing.
    • Changed targeting so it's no longer possible to target bots. (It doesn't work and causes errors with other plugins).
  • V1.3.0
    • Added support for "Haunted"
  • V1.5.0
    • Custom item name/method text support! :3

Total downloads as prior to last update: 625









DarthNinja 09-11-2011 22:02

Re: [TF2] Fake Item Messages
 
-Reserved-

byteframe 09-11-2011 23:26

Re: [TF2] Fake Item Messages
 
Thank you very much.

Snaggle 09-12-2011 00:19

Re: [TF2] Fake Item Messages
 
Thank you so much for doing this!

coeocjf 09-12-2011 02:01

Re: [TF2] Fake Item Messages
 
support only english?

DarthNinja 09-12-2011 03:09

Re: [TF2] Fake Item Messages
 
Quote:

Originally Posted by coeocjf (Post 1553447)
support only english?

I'm not sure what you're referring to

DarthNinja 09-12-2011 05:58

Re: [TF2] Fake Item Messages
 
Little update released, fixes a few things I just noticed.

Minoost 09-12-2011 10:41

Re: [TF2] Fake Item Messages
 
wow... just i can say 'awesome'

BrianGriffin 09-12-2011 15:16

Re: [TF2] Fake Item Messages
 
Great way to display item drops in a rpg mod ;)

byteframe 09-12-2011 20:39

Re: [TF2] Fake Item Messages
 
Might it be within the purview of this plugin to also fake achievement messages? Like http://forums.alliedmods.net/showthread.php?p=883207 ?


All times are GMT -4. The time now is 04:36.

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