Raised This Month: $ Target: $400
 0% 

[TF2] Money


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Gachl
BANNED
Join Date: Feb 2009
Plugin ID:
971
Plugin Version:
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Unapprover:
    Reason for Unapproving:
    requested
    Old 07-03-2009 , 08:34   [TF2] Money
    Reply With Quote #1

    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!
    Attached Files
    File Type: sp Get Plugin or Get Source (tf2money.sp - 826 views - 5.9 KB)

    Last edited by Gachl; 08-04-2009 at 04:13. Reason: new version
    Gachl is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 07-03-2009 , 09:17   Re: [TF2] Money
    Reply With Quote #2

    Howdy,

    My only suggestion is to make it threaded, if it gets stuck waiting for a death query to run is going to bog it down, especially if you think this might be deployed over many, many games.

    Neat idea though

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    Gachl
    BANNED
    Join Date: Feb 2009
    Old 07-03-2009 , 10:03   Re: [TF2] Money
    Reply With Quote #3

    Good idea, I'll TRY to do it but I have no experience with threading in SM yet...
    Gachl is offline
    Gachl
    BANNED
    Join Date: Feb 2009
    Old 07-03-2009 , 10:25   Re: [TF2] Money
    Reply With Quote #4

    btw, why I can't see this fancy plugin details bar in the original post where I can edit version number and description and stuff?
    Gachl is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 07-03-2009 , 11:34   Re: [TF2] Money
    Reply With Quote #5

    Quote:
    Originally Posted by Gachl View Post
    Good idea, I'll TRY to do it but I have no experience with threading in SM yet...
    See http://forums.alliedmods.net/showthread.php?p=642531 that was my first introduction to threading.

    Quote:
    Originally Posted by Gachl View Post
    btw, why I can't see this fancy plugin details bar in the original post where I can edit version number and description and stuff?
    You may have to repost, it was a problem with this forum a while ago.

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    Gachl
    BANNED
    Join Date: Feb 2009
    Old 07-03-2009 , 11:37   Re: [TF2] Money
    Reply With Quote #6

    hmm I remember the last two plugins I posted had the same problem but somehow after a while the bar reappeared (out of nothing?).
    Gachl is offline
    Gachl
    BANNED
    Join Date: Feb 2009
    Old 07-03-2009 , 13:01   Re: [TF2] Money
    Reply With Quote #7

    New version up (damn I failed hard )
    Code:
    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?)
    Gachl is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 07-03-2009 , 17:09   Re: [TF2] Money
    Reply With Quote #8

    Kind of similar to a plugin I requested a long long time ago.

    Ive been wanting a TF2 credit system plugin which gives credits to players based on time played on the server or maybe kills. My idea was for them to be redeemable for abilities or reserve slots etc.
    Just some ideas for ya. Like, if you were able to have it do a popup menu where you can purchase temporary abilities, that would be sick.

    The plugin similar to this idea I saw on a server one time, lagged fairly big when it made the database queries, hopefully this doesnt. Ill test it out.

    Nice work.

    Last edited by retsam; 07-03-2009 at 17:18.
    retsam is offline
    Gachl
    BANNED
    Join Date: Feb 2009
    Old 07-03-2009 , 17:52   Re: [TF2] Money
    Reply With Quote #9

    Hm the menu thing sounds interesting - still I need this plugin only for reserved slots. Maybe I posted the plugin in the wrong section because I'll not add features suggested by users, also I'll not support it.
    But everyone who knows a *little* bit of SourcePawn or programming can (and is allowed) to edit the plugin according to his wishes, so you would have to create the menu and all it's functions etc by yourself.
    When I add threading (I'll do that soon) to my version of the plugin (which is really different to this one) I'll add it to this too, so it's (hopefully) lag free (my version contains some more features like !buy so you'll get a reserved slot depending on your current amount etc etc, not public)
    Gachl is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 07-03-2009 , 18:07   Re: [TF2] Money
    Reply With Quote #10

    ummm.. ok... heh.

    Last edited by retsam; 07-03-2009 at 18:20.
    retsam 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 20:28.


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