How to install:
How to setup:
All settings are in "Plugins/Coiny/coiny_settings.ini" file. Those are following:
How to use:
How to integrate with API:
First, you use:
Features:
TODO:
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 fixes
API wasn't changed.
- Put .zip inside your "Plugins" folder;
- "Extract here";
- Go to your settings.ini OR use web control panel, and add "Coiny";
- ...
- PROFIT!!!
How to setup:
All settings are in "Plugins/Coiny/coiny_settings.ini" file. Those are following:
- 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;
- TicksPerSave: 1200 ticks approximately are similar to one minute, so defaul 2000 is a big overkill;
- StarterPack: how much money each player will be given once;
- 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;
- 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;
- 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;
- 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";
- 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:
- /money: shows your ballance. Permission: coiny.base;
- /m: shortcut for /money. Permission: coiny.base;
- /money pay (nick) (ammount): transfers 'ammount' of your coins to 'nick'. Permission: coiny.trade;
- /money give (nick) (ammount): gives 'nick' 'ammount' of coins. Permission: coiny.reward;
- /money take (nick) (ammount): takes from 'nick' 'ammount' of coins. Permission: coiny.punish;
- /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:
- Upcoming "Cheetah" compatibility;
- 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 fixes
API wasn't changed.