Raised This Month: $ Target: $400
 0% 

[CS:S] CashGifts #money


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
2279
Plugin Version:
1.0.3
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Players can give their cash to other players!
    Old 03-17-2011 , 09:02   [CS:S] CashGifts #money
    Reply With Quote #1

    [CS:S] CashGifts
    Version 1.0.3



    Description:
    I got the idea for this while posting my [CS:S] Give Cash plugin.

    This plugin ports over a feature from Killing Floor that allows players to give their cash to other players. This uses a menu rather then throwing the money on the ground however.

    Cvars control who the cash can be given to, and who the messages are shown to.

    Commands:
    • !givecash (chat) or givecash (console)
      Opens a menu listing players as determined by a cvar below. After picking a player, the user can pick a preset amount of money.
      After the user picks both, they lose X money and the player gains X money.
    • !giftcash (chat) or giftcash (console)
      Does the same as givecash
    Note: Players can specify the player and the amount in the command for more exact values.
    Example: !givecash Player2 87 would give Player2 87 cash.


    Cvars:
    • sm_cashgifts_version - Plugin Version
    • sm_cashgifts_enable "1" - <1/0>
      Enables/Disables the plugin.
    • sm_cashgifts_team "1" - <1/0>
      If set to 1, players will only be able to give cash to players on the same team.
      If set to 0, players will be able to give cash to any player (except themselves obviously).
    • sm_cashgifts_show "1" - <1/0>
      A value of 1 will cause the plugin to tell all players when someone gives someone else cash.
      A value of 0 will cause it to only announce the transaction to the involved players.
    Install Instructions:
    1. Drag and drop.

    Notes:
    ~ A log file is saved to logs/Cash_Gifts.log, just in case anyone cares.

    Version History:
    • V1.0.0
      • Initial Release
    • V1.0.1
      • Fixed a potential handle leak.
    • V1.0.2
      • Dead players can no longer give out cash (exploit fix).
    • V1.0.3
      • No longer passes client indexes through timers.
    Total downloads: 343
    Attached Files
    File Type: sp Get Plugin or Get Source (GiftCash.sp - 1175 views - 7.9 KB)
    __________________

    Last edited by DarthNinja; 01-22-2013 at 18:46.
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 03-18-2011 , 08:05   Re: [CS:S] CashGifts #money
    Reply With Quote #2

    - Reserved -
    __________________
    DarthNinja is offline
    Salakis.
    Junior Member
    Join Date: Feb 2011
    Location: Russia
    Old 04-03-2011 , 13:26   Re: [CS:S] CashGifts #money
    Reply With Quote #3

    Quote:
    Originally Posted by errors.log
    L 04/03/2011 - 13:09:15: SourceMod error session started
    L 04/03/2011 - 13:09:15: Info (map "de_dust2_unlimited") (file "errors_20110403.log")
    L 04/03/2011 - 13:09:15: [SM] Plugin encountered error 15: Array index is out of bounds
    L 04/03/2011 - 13:09:15: [SM] Displaying call stack trace for plugin "GiftCash.smx":
    L 04/03/2011 - 13:09:15: [SM] [0] Line 189, /home/groups/sourcemod/upload_tmp/phpl8OXXf.sp::MenuHandler_GiveCash()
    Quote:
    Originally Posted by Cash_Gifts.log
    L 04/03/2011 - 13:09:15: [GiftCash.smx] [Cash Gifts] Steam<164><STEAM_0:0:20565725><> gave <3<187><STEAM_0:0:19377102><> 2500 cash!
    __________________
    Sorry for my bad English

    Last edited by Salakis.; 04-03-2011 at 13:29.
    Salakis. is offline
    Send a message via ICQ to Salakis.
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 04-04-2011 , 03:28   Re: [CS:S] CashGifts #money
    Reply With Quote #4

    As far as I can tell, that error shouldn't be possible.
    Can you provide any info about your server (number of slots, etc)?
    Also details if there is anything unusual about it, for example, changes to maxplayers would be good.

    Also steps to reproduce the error would be helpful.
    __________________
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 04-04-2011 , 03:36   Re: [CS:S] CashGifts #money
    Reply With Quote #5

    As an afterthought: I have a version which lets you throw money to players or onto the ground that is almost complete.
    I'll be releasing it once I get back from this trip and can finish testing it.

    There's also a minor bug fix posted which addresses a case where the plugin could leak handles if the player canceled the second menu.
    __________________
    DarthNinja is offline
    .Squall
    New Member
    Join Date: Apr 2011
    Old 04-04-2011 , 15:38   Re: [CS:S] CashGifts #money
    Reply With Quote #6

    Quote:
    L 04/04/2011 - 22:25:10: [SM] Plugin encountered error 15: Array index is out of bounds
    L 04/04/2011 - 22:25:10: [SM] Displaying call stack trace for plugin "GiftCash.smx":
    L 04/04/2011 - 22:25:10: [SM] [0] Line 189, /home/groups/sourcemod/upload_tmp/phpl8OXXf.sp::MenuHandler_GiveCash()
    L 04/04/2011 - 22:25:53: [SM] Plugin encountered error 15: Array index is out of bounds
    L 04/04/2011 - 22:25:53: [SM] Displaying call stack trace for plugin "GiftCash.smx":
    L 04/04/2011 - 22:25:53: [SM] [0] Line 189, /home/groups/sourcemod/upload_tmp/phpl8OXXf.sp::MenuHandler_GiveCash()
    Quote:
    L 04/04/2011 - 22:25:10: [GiftCash.smx] [Cash Gifts] .Squall<847><STEAM_0:1:14216877><> gave Hank<844><STEAM_0:0:983404088><> 500 cash!
    L 04/04/2011 - 22:25:53: [GiftCash.smx] [Cash Gifts] .Squall<847><STEAM_0:1:14216877><> gave Shyller<565><STEAM_0:0:10704211><> 0 cash!
    Sry for my enslish, try plz to understand me.
    This bug appears then over givecash menu opens other menus.
    For example
    > !Givecash
    I chose player
    Plugin let me choosing how much i want to give. But i dont chose and , for example , write on console "sm_admin", or server start the vote in this time. So i dont chose how much money, but new menu overlaps give cash menu.

    If u want, i will try to record dem, because i very bad in english and u , probably, not understand me

    If u already solved this and know about this bug - sry.
    .Squall is offline
    Salakis.
    Junior Member
    Join Date: Feb 2011
    Location: Russia
    Old 04-06-2011 , 17:14   Re: [CS:S] CashGifts #money
    Reply With Quote #7

    Quote:
    Originally Posted by DarthNinja View Post
    As far as I can tell, that error shouldn't be possible.
    Can you provide any info about your server (number of slots, etc)?
    Also details if there is anything unusual about it, for example, changes to maxplayers would be good.

    Also steps to reproduce the error would be helpful.
    36 slots, change(16-36) depending on the map. However, errors are no longer fixed in logs, after installing your latest release V1.0.1. Thanks.
    __________________
    Sorry for my bad English
    Salakis. is offline
    Send a message via ICQ to Salakis.
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 04-07-2011 , 18:01   Re: [CS:S] CashGifts #money
    Reply With Quote #8

    Yeah, I think it was that menu check that I forgot to add.
    Let me know if you see anything with the latest version or if its fixed.
    __________________
    DarthNinja is offline
    .Squall
    New Member
    Join Date: Apr 2011
    Old 04-22-2011 , 13:55   Re: [CS:S] CashGifts #money
    Reply With Quote #9

    There is some bad exploit.
    Player can gift all cashes, went to spec, back to team and givecash again.
    So, plz fix this. Block players give cash 1more times at round.

    Last edited by .Squall; 04-22-2011 at 13:57.
    .Squall is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 04-23-2011 , 03:59   Re: [CS:S] CashGifts #money
    Reply With Quote #10

    That happens because CS:S is stupid and assigns a cash value when a player joins a team rather then when they spawn.

    I added a check so players can't give out cash when dead (that should fix the problem).
    __________________
    DarthNinja is offline
    Reply


    Thread Tools
    Display Modes

    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 13:03.


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