AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   KnifeMug (https://forums.alliedmods.net/showthread.php?t=53900)

FlyingMongoose 04-12-2007 23:53

KnifeMug
 
3 Attachment(s)
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)
CVARS:
  • 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

CHANGELOG:
  • 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

INSTALLATION:
  • 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)

BAILOPAN 04-13-2007 00:41

Re: [PLUGIN] KnifeMug
 
Nice work! Were you able to resolve all of the server.cfg versus OnPluginStart idiosyncrasies?

FlyingMongoose 04-13-2007 00:45

Re: [PLUGIN] KnifeMug
 
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:
Quote:

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)

BAILOPAN 04-13-2007 01:27

Re: [PLUGIN] KnifeMug
 
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.

FlyingMongoose 04-13-2007 01:30

Re: [PLUGIN] KnifeMug
 
I actually tried that...and sadly...it crashed the server...using sm plugins debug in the console

I'll try the cfg file method

BAILOPAN 04-13-2007 01:32

Re: [PLUGIN] KnifeMug
 
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.

FlyingMongoose 04-13-2007 01:38

Re: [PLUGIN] KnifeMug
 
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.

sslice 04-13-2007 14:23

Re: [PLUGIN] KnifeMug
 
Add a IsClientConnected() in the loop in FindEntityByUserId()

Edit: Nevermind, no need for that function now.

API 04-13-2007 19:20

Re: [PLUGIN] KnifeMug
 
Excellent work :)

FlyingMongoose 04-13-2007 19:39

Re: [PLUGIN] KnifeMug
 
Plugin update (check the first post)


All times are GMT -4. The time now is 09:11.

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