Money for TF2
Version 1.0.3
Support level: No support
-- This thread is obsolete, no support, no answers to questions --
If you need a money plugin use this: http://forums.alliedmods.net/showthread.php?t=96372
Description
I made this plugin for our servers so you can play and earn some $$. Then you can buy reserved slots with this money (Our prices are $2k for 1 month, $5.4k for 3 months and $8.8k for 6 months). Maybe someone want to use this plugin too, I don't care.
This plugin is not just for TF2, it *should* run with every other mod too but the description of the plugin says its Money for TF2.
Now the description (all UNDERLINED values are #defines you can edit in the sourcecode, I didn't use cvars because I was too lazy :> )
If you kill a player you steal a random amount of money ($1 - $
MAX_STEAL) and vice versa (so you can reach $0). Every player gets $
START_MONEY when he joins the first time. All values (steamid, name and money) are stored in the table
TABLENAME (db handle is
DBHANDLE). I recommend using MySQL because I didn't test it with sqlite and I never used sqlite so I don't know errors that may occur. Also if you use mysql you can process all values with php and such, so don't use sqlite!
If you type (assume / and ! are silent and public triggers) /money or !money you'll get some informations (what money is for and how much you've got atm). You can change the printed text on the lines 69 to 75 (in function
Command_Money).
Also there's a timer announcing every 80.0 seconds that you earn money on this server and you might type !money for more informations. To switch it off comment out line 46 (CreateTimer(...) in
OnPluginStart). If you want to change the text do it on line 51 (
InfoTimer).
You can change everything in this plugin if you want to to adjust it to your needs, but please keep my credits somewhere (eg. author = "GachL, edited by yourname")
You may need this
SQL Table creation script, import it to your database and if needed rename the table name (
TABLENAME should be the same).
Code:
CREATE TABLE IF NOT EXISTS `tf2money` (
`steamid` varchar(32) NOT NULL,
`username` varchar(128) character set utf8 NOT NULL,
`money` int(11) NOT NULL,
PRIMARY KEY (`steamid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Usage
CVars
Quote:
- sm_money_version
The current version of the plugin.
|
Commands
The commands are public, so regular players can use them.
The commands must be used in chat.
Quote:
- !money
Shows infos what you can do with the plugin and how much money you've got atm.
|
Example
Server console output (users will see something different):
Code:
[$$] Barack Obama stole fib $3! Now they have $503 and $277.
[$$] -ĆA|zxy stole Pukki The Great $23! Now they have $706 and $358.
[$$] Herr Doktor stole demom@n $21! Now they have $666 and $296.
[$$] -ĆA|zxy stole Jona. Low Speed, High Aim. $46! Now they have $752 and $346.
[$$] Pinchpenny stole Sylvine $25! Now they have $328 and $1278.
[$$] Barack Obama stole kingsqueakers0504 $44! Now they have $547 and $456.
[$$] FeirHeir stole Macro $26! Now they have $535 and $474.
Changelog
Code:
v1.0.0 2009/07/03
+ Plugin created.
* Hotfixed console using sm_money would cause an error.
v1.0.3 2009/07/03
* Fixed public chat trigger !money won't work (I fail!)
* Fixed suicide would make you steal your own money (yea why not?)
Mod, please disapprove this plugin!