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


Messages In This Thread
Coiny v6 (updated 31 dec 2013) - by Taugeshtu - 11-04-2012, 02:47 AM
RE: Coiny v2 (r1017) - by SashaSansay - 11-19-2012, 03:08 PM
RE: Coiny v4 (r1208) - by Taugeshtu - 02-12-2013, 12:32 AM
RE: Coiny v4 (r1208) - by xoft - 12-29-2013, 02:58 AM
RE: Coiny v4 (r1208) - by tonibm19 - 12-29-2013, 03:02 AM
RE: Coiny v4 (r1208) - by xoft - 12-29-2013, 04:37 AM
RE: Coiny v4 (r1208) - by tonibm19 - 12-29-2013, 10:10 PM
RE: Coiny v4 (r1208) - by xoft - 12-29-2013, 10:44 PM
RE: Coiny v4 (r1208) - by tonibm19 - 12-30-2013, 02:14 AM
RE: Coiny v4 (r1208) - by xoft - 12-30-2013, 07:33 PM
RE: Coiny v4 (r1208) - by tonibm19 - 12-30-2013, 07:59 PM
RE: Coiny v4 (r1208) - by xoft - 12-30-2013, 08:15 PM
RE: Coiny v4 (r1208) - by tonibm19 - 12-30-2013, 08:23 PM
RE: Coiny v4 (r1208) - by xoft - 12-30-2013, 08:45 PM
RE: Coiny v4 (r1208) - by tonibm19 - 12-30-2013, 08:58 PM
RE: Coiny v6 (updated 31 dec 2013) - by Taugeshtu - 01-02-2014, 07:50 AM
RE: Coiny v6 (updated 31 dec 2013) - by Antonio - 02-03-2014, 10:37 AM
RE: Coiny v6 (updated 31 dec 2013) - by Taugeshtu - 02-03-2014, 02:43 PM
RE: Coiny v6 (updated 31 dec 2013) - by Antonio - 02-03-2014, 09:06 PM
RE: Coiny v6 (updated 31 dec 2013) - by Antonio - 02-07-2014, 06:38 AM
RE: Coiny v6 (updated 31 dec 2013) - by tonibm19 - 02-10-2014, 02:11 AM



Users browsing this thread: 5 Guest(s)