Thread: [ANY] Bacon
View Single Post
Author Message
mukunda
Member
Join Date: Sep 2012
Old 06-02-2013 , 18:12   [ANY] Bacon
Reply With Quote #1

Bacon

A must have installation on all servers to allow bacon transactions and statistics.



With this plugin, players can finally share what they love most with their closest friends. Players can type !bacon <friend's name> ingame to pass some of their bacon to that player. If they change their mind, they can invoke !nobacon <bad friend's name> to take away their bacon.

Features
Threaded SQL powered bacon management.
Transaction throttling to prevent bacon from clogging up your system.
Localization support.
Ability to give the server bacon.
Cleanup feature in case the bacon gets out of control. The server will eat all of the bacon.
Automatic updating to keep your bacon smelling great! (requires updater)
Fresh Delicious Bacon
Command List

sm_bacon <player>
Give bacon to player. If no argument is given, it will show how much bacon you have. Specify "server" to give bacon to the server. The server can also give bacon to players.
sm_nobacon <player>
Take bacon from player. Specify "server" to take your bacon away from the server.
Alias: sm_takebacon
sm_mostbacon
Prints who has the most bacon.
sm_drop_bacon [server command]
Cleanup function as mentioned in the features. Destroys all bacon.
Warning: will halt server for up to two (2) seconds.
Any player can only give up to one (1) bacon to another player. And (of course) any of these commands can be used in chat with the chat trigger prefix (i.e. !bacon, !nobacon, !mostbacon)

CVars

A cvar configuration file will be generated automatically at cfg/sourcemod/plugin.bacon.cfg for you when you run bacon for the first time.

Recommended to delete this file after updates to get the most out of your bacon!

Public CVar: serves_bacon
Servers can now be easily checked if bacon service is available!
sm_bacon_notify <0,1,2>
Controls who sees bacon transactions take place.

0 = Do not notify players when bacon is given or taken.
1 = Target of transaction sees a message.
2 = Everyone sees a message.
3 = Everyone sees a gift message. (DEFAULT) (NEW)

Visual Examples:
(MODE1) "<player> gave you some bacon" is seen by the target.
(MODE2) "<player> gave some bacon to <player>" is seen by everyone.
(MODE3) "<player> has received a gift: Bacon" is seen by everyone

Colors for mode3 are supported for CSS (I think),TF2, and CSGO
sm_bacon_cooldown <decimal number>
Controls how long clients must wait between execution of bacon transactions.
Default = 7.77
Units are in seconds.
Changing this resets all cooldowns.
sm_bacon_topcount <1-10>
Controls how many Bacon Masters are printed to people who use !mostbacon
Default = 1
Installation

Copy files from the archive provided below into your sourcemod folder. A mapchange or a server restart is required for the system to function.

Optional: Install Updater to keep your bacon bug free (ew!) and tasty!

1.1.0 NOTICE: The database operations are now using GetSteamAccountID which is a sourcemod 1.5 feature. If you aren't already using the latest and greatest SourceMod, you will need to upgrade to use this plugin (until the near future when 1.5 is a reality of course).

Localization

Special thanks to the people who have contributed to making Bacon available in every language!
  • German translations by mikazoid

Changes

Keep track of whats happening to your bacon:
Code:
// 1.1.2
//   minor bugfix
//   german translations provided by mikazoid
//
// 1.1.1
//   attempted to fix sql escape string thingy
//
// 1.1.0 9:33 AM 6/12/2013
//   removed [SM] tags from code, if these are desired, place them in the translations
//   added some delicious colors
//   added gift emulation layer
//   added public cvar
//   added sm_bacon_topcount
//   lowered default bacon cooldown
//   improved database access (all existing bacon will be erased, sorry!)
//
// 1.0.3b 9:57 PM 6/5/2013
//   localization improvements (grammar flexibility)
//   notify options added
//   cooldown options added
//   freshened up bacon
//   added user manual
//
// 1.0.2b
//   fixed memory leak
//   enhanced plugin description
//   added updater support
//   freshened up bacon

Screenshots

Below are a few pictures of the delectable system in progress. The first one shows me typing in a bacon command--attempting to give myself some of my bacon.

Of course, in the second picture it shows that it is a strict rule that one simply cannot give himself bacon, and it can only be shared with others.

Picture #3 shows me demanding bacon via abuse of SourceMod's admin chat feature. A person agrees to my demand directly after, and then fails to retract his decision by using an invalid bacon command. I then count my bacon by entering the bacon command without any arguments.

The purple text is not included and is actually a bug in one of my other plugins.

The last picture is an accurate visual the recipients when a bacon transaction takes place. (Contributed by r3dw3r3w0lf)

New in 1.1.0: Bacon gift notifications!
Attached Thumbnails
Click image for larger version

Name:	1.hot.jpg
Views:	1043
Size:	46.2 KB
ID:	120763   Click image for larger version

Name:	2.delicious.jpg
Views:	1205
Size:	89.5 KB
ID:	120764   Click image for larger version

Name:	3.bacon!!!.jpg
Views:	1095
Size:	64.3 KB
ID:	120765   Click image for larger version

Name:	4.received-bacon.jpg
Views:	858
Size:	30.6 KB
ID:	120904   Click image for larger version

Name:	5.bacon.gift.jpg
Views:	954
Size:	54.3 KB
ID:	121196  

Attached Files
File Type: zip bacon1.1.2.zip (26.1 KB, 435 views)
File Type: sp Get Plugin or Get Source (bacon.sp - 390 views - 32.1 KB)

Last edited by mukunda; 06-16-2013 at 21:33. Reason: 1.1.2
mukunda is offline