Coder Social home page Coder Social logo

boxofdevs / commandshop Goto Github PK

View Code? Open in Web Editor NEW
31.0 13.0 10.0 120 KB

Players have to pay items or money to use specific commands! A PocketMine plugin.

License: Other

PHP 100.00%
money pocketmine-plugins pmmp pocketmine economyapi economy commands mcpe boxofdevs pocketmine-mp

commandshop's People

Contributors

dragonwocky avatar erkam246 avatar himbeersaftlp avatar poggit-bot avatar remotevase avatar vaults1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commandshop's Issues

Todo

Todo lists:

Todo until the plugin works:

  • Implement managing commands (add, remove etc.)
  • Add buying (the function itself)
  • Add buying with signs
  • Implement sign creation
  • Paying with EconomyAPI

Todo until release:

  • Add buying with a command
  • Paying with items
  • Changeable messages (Language file support will be added later on)
  • Write a Wiki
  • Add command for adding commands to commands (<-- Such descriptive, much wow)
  • Sign buy confirmation with double-tap
  • Change sign's command when using /cshop sign more than one time (easy)
  • Automatic sign deletion from config on break
  • A descriptive help command xD

Todo until V2:

  • Automatic sign deletion from config when a sign breaks by breaking the attached block
  • Add variables for args e.g. {arg1}, {arg2} and so on
  • Support for different Economy plugins
  • Execute as player with auto-perm management
  • Multiple languages (selectable)

CommandShopUI!!

Brief description

Its not an issue but it would be awesome if you can dev it as UI based command shop!!

Steps to reproduce

  1. ...
  2. ...
  3. ...

Expected result

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)

just wondering

So like.... where is the how-to on how to use this ?

:P usually a link or something is in the readme... but I guess not for you guys !

Does this plugin even work yet ? I was gonna test it... but... too confusing.

Using a command sign while no price is set

Brief description

when you use a command sign for a command with no price set it sends an internal server error

Steps to reproduce

  1. Create a command (without setting up price)
  2. Create a command sign
  3. Try to use it

Expected result

Actual result

Server Information

  • CommandShop Version: Current (sorry ik this isn’t politically correct)
  • Software Version:
  • Server OS:

CrashDumps/Errors


thread/CRITICAL ErrorException: "Undefined index: price" (EXCEPTION) in "plugins/CommandShop_dev-113.phar/src/BoxOfDevs/CommandShop/CommandShop" at line 172

on your wiki....

LOL, SET RICE... YES, SET ALL THE RICE... SOOO MUCCCHH RIICEEEEE

Go fix that silly typo xD

And thank you guys for making this plugin ! I hope this works smoothly for me <3

Internal error

Brief description

Steps to reproduce

  1. ...when u do /cshop sign and tap sign
  2. ...
  3. ...

Expected result

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

16.08 20:35:05 [Server] Server thread/CRITICAL ErrorException: "Object of class BoxOfDevs\CommandShop\CShopCommand\CShopCommand could not be converted to string" (EXCEPTION) in "plugins/CommandShop_dev-115.phar/src/BoxOfDevs/CommandShop/CommandShop" at line 109
16.08 20:35:05 [Server] Server thread/DEBUG #0 (): pocketmine\utils\Utils::errorExceptionHandler(integer 4096, string[96] Object of class BoxOfDevs\CommandShop\CShopCommand\CShopCommand could not be con, string[128] phar:///plugins/CommandShop_dev-11, integer 109, array[2])
16.08 20:35:05 [Server] Server thread/DEBUG #1 plugins/CommandShop_dev-115.phar/src/BoxOfDevs/CommandShop/CommandShop(109): str_ireplace(array[1], array[1], string[77] {prefix}Tap the sign again to confirm that you want to buy the command {cmd}!)
16.08 20:35:05 [Server] Server thread/DEBUG #2 plugins/CommandShop_dev-115.phar/src/BoxOfDevs/CommandShop/CShopListener(82): BoxOfDevs\CommandShop\CommandShop->getMessage(string[77] {prefix}Tap the sign again to confirm that you want to buy the command {cmd}!, array[1])
16.08 20:35:05 [Server] Server thread/DEBUG #3 src/pocketmine/plugin/MethodEventExecutor(38): BoxOfDevs\CommandShop\CShopListener->onSignTouch(object pocketmine\event\player\PlayerInteractEvent)
16.08 20:35:05 [Server] Server thread/DEBUG #4 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(object BoxOfDevs\CommandShop\CShopListener, object pocketmine\event\player\PlayerInteractEvent)
16.08 20:35:05 [Server] Server thread/DEBUG #5 src/pocketmine/event/Event(99): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerInteractEvent)
16.08 20:35:05 [Server] Server thread/DEBUG #6 src/pocketmine/level/Level(1914): pocketmine\event\Event->call()
16.08 20:35:05 [Server] Server thread/DEBUG #7 src/pocketmine/Player(2417): pocketmine\level\Level->useItemOn(object pocketmine\math\Vector3, object pocketmine\item\ItemBlock, integer 4, object pocketmine\math\Vector3, object pocketmine\Player, boolean 1)
16.08 20:35:05 [Server] Server thread/DEBUG #8 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(150): pocketmine\Player->handleInventoryTransaction(object CortexPE\network\InventoryTransactionPacket)
16.08 20:35:05 [Server] Server thread/DEBUG #9 src/pocketmine/network/mcpe/protocol/InventoryTransactionPacket(158): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleInventoryTransaction(object CortexPE\network\InventoryTransactionPacket)
16.08 20:35:05 [Server] Server thread/DEBUG #10 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(110): pocketmine\network\mcpe\protocol\InventoryTransactionPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter)
16.08 20:35:05 [Server] Server thread/DEBUG #11 src/pocketmine/network/mcpe/protocol/BatchPacket(123): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object CortexPE\network\InventoryTransactionPacket)
16.08 20:35:05 [Server] Server thread/DEBUG #12 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(110): pocketmine\network\mcpe\protocol\BatchPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter)
16.08 20:35:05 [Server] Server thread/DEBUG #13 src/pocketmine/Player(3126): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket)
16.08 20:35:05 [Server] Server thread/DEBUG #14 src/pocketmine/network/mcpe/RakLibInterface(169): pocketmine\Player->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket)
16.08 20:35:05 [Server] Server thread/DEBUG #15 vendor/pocketmine/raklib/src/server/ServerHandler(99):

command sign works but it shows empty(no text on sign)

Brief description

Steps to reproduce

  1. ...
  2. ...
  3. ...

Expected result

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)

Config.yml TESSERACT

Warning: file_put_contents(C:\PocketMine-MP\plugins\CommandShop/config.yml): failed to open stream: No such file or directory in C:\PocketMine-MP\src\pocketmine\utils\Config.php on line 190
Plugins i use:[Tesseract] [21:50:51] INFO> Plugins (34): FolderPluginLoader v1.0.1, DevTools v1.11.1, superBAR v1.6.2, AdvancedKits v5.1, AntiFly v1.0.0, AntiSpamPro v1.0.8, BetterVIPSlots v2, Broadcaster v1.16, CombatLogger v1.2.0, CommandShop v1.0.0, CosmeticMenu v1.0.0, CustomAlerts v1.6, EconomyAPI v2.0.9, EconomyAuction v2.0.2, EconomyCasino v2.0.2, EconomyJob v2.0.4, EconomyLand v2.0.9, EconomyProperty v2.0.6, EconomyPShop v2.0.2, EconomySell v2.0.7, EconomyShop v2.0.7, EconomyTax v2.0.3, EconomyUsury v1.0.1, EnderAuth v0.0.1, EssentialsPE v2.0.0, FactionsPro v1.3.7.AWZ, iProtector v3.1b, MSpawns v1.5, Neon v1.0.5, NoAdvertisingPE v1.0.1, PurePerms v1.4.0-INDEV, WorldProtect v2.2.0, EconomyAirport v2.0.4, PureChat v1.4.0

Cant

Brief description

Whenever I add 3 new commands in the config when I do /cshop list it doesn't show up it only shows up 2 command the example and the 2nd command but the 3rd doesn't show up

Steps to reproduce

  1. ...
  2. ...
  3. ...

Expected result

It will be fix

Actual result

Gonna be fix

Server Information

  • CommandShop Version: 1.0.0
  • Software Version:
  • Server OS:

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)

RankShopUI

Brief description

Hi, I'm asking for if you can do a RankShopUI because it's don't exist i think because i searched a lot.Bes regard

Steps to reproduce

  1. ...
  2. ...
  3. ...

Expected result

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)

Item counter is severely broken and no one ever noticed

Brief description

Unfairly, too many items get removed.

Steps to reproduce

  1. Try removing one item when you have multiple stacks of only one item (e.g. swords)
  2. All of them get removed

Expected result

Only one gets removed

Actual result

All of them get removed

The reason for this problem is this function by Ad5001 that's supposed to remove the correct amount of items, but apparently no one ever tested it with non-stacking items lol.

Possible fix (not yet tested):

private function removeItems(Item $item, BaseInventory $inventory){
     $checkDamage = !$item->hasAnyDamageValue();
     $checkTags = $item->hasCompoundTag();
     $checkCount = $item->getCount() === null ? false : true;
     $count = $item->getCount();
     foreach($inventory->getContents() as $index => $i){
          if($item->equals($i, $checkDamage, $checkTags)){
               if($checkCount && $i->getCount() > $count) {
                    $i->setCount($i->getCount() - $count);
                    $inventory->setItem($index, $i);
                    return;
               } elseif($checkCount && $i->getCount() < $count) {
                    $count -= $i->getCount();
                    $inventory->clear($index);
               } else {
                    $inventory->clear($index);
                    return;
               }
          }
     }
}

Thanks to @MCPEATECH for finding this out.

Pmmp4

Brief description

Steps to reproduce

  1. ...
  2. ...
  3. ...

Expected result

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)

Hey, there is a pmmp4 version ?

/cshop add name command not working

Brief description

Everyone I type /cshop add anyname any command
I get "An unknown error occurred while attempting to perform this command"

Steps to reproduce

  1. .../cshop add spawn spawn
  2. ...
  3. ...

Expected result

fix the plugin

screenshot_20180314-042223
screenshot_20180314-042232

Actual result

Server Information

  • CommandShop Version:
  • Software Version:
  • Server OS:

CrashDumps/Errors

14.03 09:13:51 [Server] Server thread/INFO [Broadcaster] Report Hackers and trouble makers 
14.03 09:13:11 [Server] Server thread/DEBUG #25 /jar/PocketMine-1.2.10-dev.phar(1): require(string phar:///jar/PocketMine-1.2.10-dev.phar/src/pocketmine/PocketMine.php) 
14.03 09:13:11 [Server] Server thread/DEBUG #24 src/pocketmine/PocketMine(556): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /, string /plugins/) 
14.03 09:13:11 [Server] Server thread/DEBUG #23 src/pocketmine/Server(1744): pocketmine\Server->start() 
14.03 09:13:11 [Server] Server thread/DEBUG #22 src/pocketmine/Server(2158): pocketmine\Server->tickProcessor() 
14.03 09:13:11 [Server] Server thread/DEBUG #21 src/pocketmine/Server(2283): pocketmine\Server->tick() 
14.03 09:13:11 [Server] Server thread/DEBUG #20 src/pocketmine/Server(2531): pocketmine\network\Network->processInterfaces() 
14.03 09:13:11 [Server] Server thread/DEBUG #19 src/pocketmine/network/Network(89): pocketmine\network\mcpe\RakLibInterface->process() 
14.03 09:13:11 [Server] Server thread/DEBUG #18 src/pocketmine/network/mcpe/RakLibInterface(88): raklib\server\ServerHandler->handlePacket() 
14.03 09:13:11 [Server] Server thread/DEBUG #17 vendor/pocketmine/raklib/server/ServerHandler(103): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 174.232.7.160 8888, raklib\protocol\EncapsulatedPacket object, integer 0) 
14.03 09:13:11 [Server] Server thread/DEBUG #16 src/pocketmine/network/mcpe/RakLibInterface(149): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object) 
14.03 09:13:11 [Server] Server thread/DEBUG #15 src/pocketmine/Player(2964): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object) 
14.03 09:13:11 [Server] Server thread/DEBUG #14 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object) 
14.03 09:13:11 [Server] Server thread/DEBUG #13 src/pocketmine/network/mcpe/protocol/BatchPacket(115): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\CommandRequestPacket object) 
14.03 09:13:11 [Server] Server thread/DEBUG #12 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\CommandRequestPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object) 
14.03 09:13:11 [Server] Server thread/DEBUG #11 src/pocketmine/network/mcpe/protocol/CommandRequestPacket(54): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleCommandRequest(pocketmine\network\mcpe\protocol\CommandRequestPacket object) 
14.03 09:13:11 [Server] Server thread/DEBUG #10 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(220): pocketmine\Player->chat(string /cshop add spawn spawn) 
14.03 09:13:11 [Server] Server thread/DEBUG #9 src/pocketmine/Player(2117): pocketmine\Server->dispatchCommand(pocketmine\Player object, string cshop add spawn spawn) 
14.03 09:13:11 [Server] Server thread/DEBUG #8 src/pocketmine/Server(1989): pocketmine\command\SimpleCommandMap->dispatch(pocketmine\Player object, string cshop add spawn spawn) 
14.03 09:13:11 [Server] Server thread/DEBUG #7 src/pocketmine/command/SimpleCommandMap(258): pocketmine\command\PluginCommand->execute(pocketmine\Player object, string cshop, array Array()) 
14.03 09:13:11 [Server] Server thread/DEBUG #6 src/pocketmine/command/PluginCommand(58): BoxOfDevs\CommandShop\CommandShop->onCommand(pocketmine\Player object, pocketmine\command\PluginCommand object, string cshop, array Array()) 
14.03 09:13:11 [Server] Server thread/DEBUG #5 CommandShop_v1.0.0.phar/src/BoxOfDevs/CommandShop/CommandShop(238): pocketmine\plugin\PluginBase->getConfig() 
14.03 09:13:11 [Server] Server thread/DEBUG #4 src/pocketmine/plugin/PluginBase(244): pocketmine\plugin\PluginBase->reloadConfig() 
14.03 09:13:11 [Server] Server thread/DEBUG #3 src/pocketmine/plugin/PluginBase(264): pocketmine\utils\Config->__construct(string /plugins/CommandShop/config.yml) 
14.03 09:13:11 [Server] Server thread/DEBUG #2 src/pocketmine/utils/Config(86): pocketmine\utils\Config->load(string /plugins/CommandShop/config.yml, integer -1, array Array()) 
14.03 09:13:11 [Server] Server thread/DEBUG #1 src/pocketmine/utils/Config(155): yaml_parse(string ---..buy.money.success: '{prefix}You successfully bought the command {cmd} for {amount}.. {unit}!{line}{prefix}The command has already been executed.'..buy.money.miss: '{error}You don''t have enough money to buy this command. You would.. need {amount} {unit}!'..buy.item.success: '{prefix}You successfully bought the command {cmd} with the item.. {item}!{line}{prefix}The command has already been executed.'..buy.item.miss: '{error}You don''t have enough items to buy this command, items needed:{line}Item:.. {item} Amount: {amount}'..buy.contactadmin: '{line}If you are a normal user, please contact your server administrator!'..command.notfound: '{error}Command {cmd} wasn''t found in the list of buyable commands!'..sign.confirm: '{prefix}Tap the sign again to confirm that you want to buy the command.. {cmd}!'..sign.noperm: '{error}You don''t have the permission to buy commands via signs!'..sign.nobreak: '{error}You don''t have the permission to break CommandShop signs!'..buycmd.disabled: '{error}/buycmd is disabled for this buyable command!'..commands:.. example:.. cmds:.. - tp {player} 123 123 123.. buycmd: "true".. price:.. paytype: item.. item: 1:0:64.. demon:.. cmds:.. - kit demon.. buycmd: "true".. price:5000.. paytype: item.. item: 259:0:1.......) 
14.03 09:13:11 [Server] Server thread/DEBUG #0 (): pocketmine\error_handler(integer 2, string yaml_parse(): scanning error encountered during parsing: could not find expected ':' (line 30, column 14), context while scanning a simple key (line 29, column 5), string phar:///jar/PocketMine-1.2.10-dev.phar/src/pocketmine/utils/Config.php, integer 155, array Array()) 
14.03 09:13:11 [Server] Server thread/CRITICAL ErrorException: "yaml_parse(): scanning error encountered during parsing: could not find expected ':' (line 30, column 14), context while scanning a simple key (line 29, column 5)" (EXCEPTION) in "src/pocketmine/utils/Config" at line 155
14.03 09:13:11 [Server] Server thread/CRITICAL Unhandled exception executing command 'cshop add spawn spawn' in cshop: yaml_parse(): scanning error encountered during parsing: could not find expected ':' (line 30, column 14), context while scanning a simple key (line 29, column 5)

I don't think is supposed to happen... xD

2017-02-24 [Tesseract] [00:18:56] INFO> [CommandTracker] /cshop buy example
2017-02-24 [Tesseract] [00:18:56] CRITICAL> Unhandled exception executing command 'cshop buy example' in cshop: Call to undefined function BoxOfDevs\CommandShop\getItem()
2017-02-24 [Tesseract] [00:18:56] CRITICAL> Error: "Call to undefined function BoxOfDevs\CommandShop\getItem()" (EXCEPTION) in "/plugins/CommandShop-master/src/BoxOfDevs/CommandShop/main" at line 121

info about my server... running tesseract, and this plugin, I did /cshop buy example & it throws this error... perhaps a small issue ?

Permission Node for /cshop list

Brief description

This isn't an issue but a feature request. Add a separate permission node for /cshop list so players can see what commands they can buy with /buycmd

Edited messages are not displayed in ingame

Brief description

The edited messages in the Config.yml are not accepted

Steps to reproduce

  1. Edit the messages in the config
  2. Restart the server once
  3. Buy a command and look in the chat.
    There stand still the standard news and not from the Cobfig

Expected result

I would wish that the edited messages from the Config synonymous ingame displayed

Actual result

Currently the edited messages are taken from the config not ingame

Server Information

CrashDumps/Errors

Paste your CrashDump or error by replacing this text (DON'T delete the backticks!)
``` No CD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.