Coiny v6 (updated 31 dec 2013)
#1
Wink 
How to install:
  1. Put .zip inside your "Plugins" folder;
  2. "Extract here";
  3. Go to your settings.ini OR use web control panel, and add "Coiny";
  4. ...
  5. PROFIT!!!

How to setup:
All settings are in "Plugins/Coiny/coiny_settings.ini" file. Those are following:
  1. SaveMode: Timed, Paranoid or Relaxed; Timed will save every Nth tick, Paranoid will save on every change, Relaxed will save ONLY on server REGULAR shutdown;
  2. TicksPerSave: 1200 ticks approximately are similar to one minute, so defaul 2000 is a big overkill;
  3. StarterPack: how much money each player will be given once;
  4. AllowNegativeBalance: 0 = disallowed, 1 = allowed. Normally negative ballance will appear only if one punish a player with /money take really hard. Could be done via other plugins;
  5. AllowPartialTransfer: 0/1, if player use /money pay with not enough coins in pocket, he will pay all coins he has OR payment will be rejected;
  6. LogHackAttempts: 0/1, this value regulates whenever server will log players' attempts to use commands they should not know about and have no permission to use;
  7. Messages key: those allow you to customize your messages upon command usage. Say you don't like coins. You could use MONEY! There are lots of keys, thing to remember: it goes like Prefix-amount-Middle-other player's name-Postfix. Spaces are not included (available as DLC). Sometimes there is no "other player";
  8. AdvancedMessages: 0/1, this one affects only messages upon balance check. You can set limit for low balance, middle balance, everything higher or equals to middle balance is considered high. Setting up is pretty straight-forward, it's just plain text;

How to use:
  1. /money: shows your ballance. Permission: coiny.base;
  2. /m: shortcut for /money. Permission: coiny.base;
  3. /money pay (nick) (ammount): transfers 'ammount' of your coins to 'nick'. Permission: coiny.trade;
  4. /money give (nick) (ammount): gives 'nick' 'ammount' of coins. Permission: coiny.reward;
  5. /money take (nick) (ammount): takes from 'nick' 'ammount' of coins. Permission: coiny.punish;
  6. /money freeze: freezes your coins and allow you to have virtually unlimited ammount of them (for admins to test stuff in case they want to play like a regular players and don't want to mess their bankroll). Permission: coiny.freeze;

How to integrate with API:
First, you use:
local _coiny_plugin = PluginManager:GetPlugin("Coiny")
Then you use:
local _result = _coiny_plugin:Call("FunctionName", Argument1, Argument2, ..., ArgumentN)
Coiny API functions:
  • GetExactPlayername(IN_playername) - given a short name, returns exact player name.
  • TransferMoney(IN_from_name, IN_to_name, IN_ammount) - returns ammount of transferred coins;
  • GiveMoney(IN_playername, IN_ammount) - gives player coins;
  • TakeMoney(IN_playername, IN_ammount) - takes coins from player;
  • GetMoney(IN_playername) - returns player coins ammount;
  • SetMoney(IN_playername, IM_ammount) - sets player coins ammount;

Features:
  • Almost all operations are fail-safe;
  • Plugin API is fail-safe: data follows setted restictions (negative ballance, partial transfer operations) sctrictly, even when called from outside;
  • Paranoid save mode is working even when functions are called from outside, but smartly, not producing saving overhead from internal calls;
  • Functions could not work with partial names, however there is a function to get full name for a shortcut (this way commands work with short playernames).
    What that means is that if you have player Taugeshtushtushtushtushtu (for example), and are willing to give him 100 coins, you can use following:
    /m give Tau 100
  • If your player don't have needed permission - he won't see commans he can't use in /help, he won't be able to use them and he will not be given any warning (since security through being a ninja is good). However, if you want to - he will be reported in server logs.
    Such functionality was written to assist live server admins to catch cheaters. A person who tries to use what he shouldn't use is not necessary a cheater, but very well could be one (so, you might want to pay him some attention).

TODO:
  1. Upcoming "Cheetah" compatibility;
  2. Check for proper "ammount" value in commands;

V6 update:
Simple web-admin panel (I plan to expand it with showing all records instead of only online players, and add simple "playername - balance" input textboxes, so you can edit some bad guy's balance directly and fast)
Implemented expanded messages system (see in settings.ini)
For some reason, few things were broken, so I fixed it after tonibm19 fixesBig Grin
API wasn't changed.


Attached Files
.zip   Coiny.zip (Size: 6.4 KB / Downloads: 641)
Reply
Thanks given by: SH_Net , Antonio
#2
doesn't work on r1024(
Reply
Thanks given by:
#3
Updated for r1208
Reply
Thanks given by:
#4
This plugin should be worth upgrading. I think it should use a proper database backend for storage, and maybe a small API library file. It'd be great if it was developed on GitHub, I'd like to contribute, too.
Reply
Thanks given by:
#5
Why don't we make an organitzation for plugin developing? we could put there my jobs plugin and Coiny.
Reply
Thanks given by:
#6
We already have the mc-server organization, and some plugins are already there - Core, PerfPages and ProtectionAreas. I'd love to add Coiny there, together with possibly others, but it's not my decision to make - their authors need to make that decision.
Reply
Thanks given by:
#7
Just tried the plugin and it doesn't work, it's almost all broken. How do I do jobs now? Undecided

It took my a while but I fixed it.
I broke Taugeshtu good coding, because I needed some time to know how to fix it Wink.
Maybe I fix it without breaking Taugeshtu coding, now I know how to fix it.
I tried /m pay and /m give. Saving it's working.


Attached Files
.zip   Coiny.zip (Size: 3.85 KB / Downloads: 338)
Reply
Thanks given by:
#8
I've written a PM to Taugeshtu asking him for permission to put the plugin on GitHub under the mc-server organization. No point in changing the code before that happens.
Reply
Thanks given by:
#9
Here is a proper fixed version of Coiny, without breaking any codeTongue
Now I can continue working on Jobs Smile


Attached Files
.zip   Coiny.zip (Size: 4.63 KB / Downloads: 349)
Reply
Thanks given by: Taugeshtu
#10
Coiny is on GitHub, fix it there Smile
Reply
Thanks given by:




Users browsing this thread: 4 Guest(s)