Raised This Month: $285 Target: $400


Post New Thread Reply   
Thread Tools Display Modes
Veteran Member
Join Date: Mar 2004
Plugin ID:
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Adds Knife Mugging to Counter-Strike: Source
    Old 04-12-2007 , 23:53   KnifeMug
    Reply With Quote #1

    This plugin does 3 different forms of knife mugging.
    • 1: Hard cash value
      • Always takes either the value set or as much money as the victim has and gives to killer
    • 2: Percentage
      • Take a percentage of the victim's cash and gives it to the killer
    • 3: Active Mugging/Damage Mugging
      • This will take a certain percentage of the victims money dependant on the damage that the attacker does. (Does not necessarily have to kill)
        • 01-20 Damage: 25% (1/4)
        • 21-99 Damage: 33% (1/3)
        • 100 > Damage: 50% (1/2)
    • km_mugcash
      • 0 = Off
      • 1 = Hard Cash (km_mugcash value)
      • 2 = Percentage on Death (km_mugpercent value)
      • 3 = Percentage on Damage
    • km_mugcash
      • Sets the cash for knife mugging
      • Default Values: Anywhere from 1 to 16000
    • km_mugpercent
      • Sets the amount of money taken in a mugging based on percent
      • MUST BE A DECIMAL VALUE. I personally suggest 0.33
      • Default Values: 0.0 to 1.0

    • 2.0.0
      • Rewrite to optimize code a bit and make easier to manage
      • Removed sm_damagemugging (replaced with km_enable 3)
      • Replaced sm_mugcash with km_mugcash
      • Replaced sm_mugpercent with km_mugpercent
      • Fixed version cvar. km_version
    • 1.1.0
      • Added km_version cvar
      • Added translations file
      • Change FloatRound to RoundFloat to keep with consistency.
    • 1.0.3
      • Fixed a potential bug that could sometimes cause crashes
    • 1.0.2
      • Added a console based output for all mugs
    • 1.0.1
      • Fixed a bug that prevented the plugin from working sometimes when dealing with player_hurt.
      • Now uses new native GetClientOfUserId instead of FindEntity function.
      • Made code smaller (used a smaller font) - joke...LAUGH! (thank you to whoever's setinfo this is on irc and bailopan for saying it
    • 1.0.0
      • Released

    • Step 1:
      • Click "Get Plugin" at the bottom of the post and save to your addons\sourcemod\plugins directory
    • Step 2:
      • Download the "plugin.knifemug.txt" file and put it into your addons\sourcemod\translations directory

    Thank you to everyone who helped out on this . I could list, but you know who you are.

    And of course thanks to BAILOPAN, DamagedSoul, and the rest of the SourceMod dev team for working out a few snags I hit.

    Thank you to SteamFriends for allowing me to test this on their servers.

    Oh yeah, thanks to mattie for the original knife mugging concept (sorry man, I just don't like eventscripts)
    Attached Files
    File Type: sp Get Plugin or Get Source (knifemug.sp - 6739 views - 12.0 KB)
    File Type: txt knifemug.phrases.txt (398 Bytes, 3565 views)
    File Type: cfg knifemug.cfg (1.4 KB, 3036 views)

    Last edited by FlyingMongoose; 04-26-2008 at 09:41. Reason: Update (version 2.0.0)
    FlyingMongoose is offline
    Join Date: Jan 2004
    Old 04-13-2007 , 00:41   Re: [PLUGIN] KnifeMug
    Reply With Quote #2

    Nice work! Were you able to resolve all of the server.cfg versus OnPluginStart idiosyncrasies?
    BAILOPAN is offline
    Veteran Member
    Join Date: Mar 2004
    Old 04-13-2007 , 00:45   Re: [PLUGIN] KnifeMug
    Reply With Quote #3

    It seems so...

    But I still think there may be some other issues here and there:

    for instance I saw the server giving this error:
    L 04/12/2007 - 23:21:29: [SM] Native "GetClientUserId" reported: Client 2 is not connected
    Which I don't actually think has anything to do with my plugin, though this issue seems to only occur "once in a while", and when dealing with the player_hurt event.

    I put that little problem into the "nothing I can do about it" column, and went ahead and released it, because as far as I know, there is nothing I can change in my code to fix it.

    Though it always works in player_death.

    If there's any bugs anyone else sees please let me know, and if there's any addition to this plugin that people might like please let me know. As far as I know there is little to nothing I can do to optimize this plugin any more than I already have.

    Also, suggestion for the "sp.gif" for the file uploader: the official pawn...well...pawn scaled down....maybe on a "piece of paper" for the source, and without said "piece of paper" for compiled (.smx)

    Last edited by FlyingMongoose; 04-13-2007 at 00:57.
    FlyingMongoose is offline
    Join Date: Jan 2004
    Old 04-13-2007 , 01:27   Re: [PLUGIN] KnifeMug
    Reply With Quote #4

    You may want to toggle debug mode on to see exactly where this is happening. You can do this either via "sm plugins debug" or setting "debug" to "yes" in configs/plugin_settings.cfg

    Debug mode will show exactly where errors come from.
    BAILOPAN is offline
    Veteran Member
    Join Date: Mar 2004
    Old 04-13-2007 , 01:30   Re: [PLUGIN] KnifeMug
    Reply With Quote #5

    I actually tried that...and sadly...it crashed the server...using sm plugins debug in the console

    I'll try the cfg file method
    FlyingMongoose is offline
    Join Date: Jan 2004
    Old 04-13-2007 , 01:32   Re: [PLUGIN] KnifeMug
    Reply With Quote #6

    how soon after did it crash the server? instantly or after something happened?

    the console debug command is kind of an experimental feature - it's been tested but not heavily. if you have mdmps and a corresponding revision # those would help greatly.
    BAILOPAN is offline
    Veteran Member
    Join Date: Mar 2004
    Old 04-13-2007 , 01:38   Re: [PLUGIN] KnifeMug
    Reply With Quote #7

    instantly, ummm, well I guess I can make it crash again >.< lol

    when I get what you need I'll go ahead and post in the bug report.
    FlyingMongoose is offline
    Senior Member
    Join Date: Feb 2005
    Location: Texas, USA
    Old 04-13-2007 , 14:23   Re: [PLUGIN] KnifeMug
    Reply With Quote #8

    Add a IsClientConnected() in the loop in FindEntityByUserId()

    Edit: Nevermind, no need for that function now.

    Last edited by sslice; 04-13-2007 at 19:01.
    sslice is offline
    Veteran Member
    Join Date: May 2006
    Old 04-13-2007 , 19:20   Re: [PLUGIN] KnifeMug
    Reply With Quote #9

    Excellent work
    API is offline
    Send a message via AIM to API
    Veteran Member
    Join Date: Mar 2004
    Old 04-13-2007 , 19:39   Re: [PLUGIN] KnifeMug
    Reply With Quote #10

    Plugin update (check the first post)
    FlyingMongoose is offline

    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 16:39.

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