Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Economy API Help

Comments in 'Plugin Development' started by IcePL, Mar 22, 2016.

  1. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    Hi how to reduce the player money?
    I need this to my command.
    E.g /buy enchant (and pay to this 5000 money)
  2. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Last edited: Mar 22, 2016
  3. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    I have that error
    Code:
    [Server] [19:36:12] [CRITICAL]: Unhandled exception executing command 'party' in party: Class party\EconomyAPI not found
    [Server] [19:36:12] [CRITICAL]: ClassNotFoundException: "Class party\EconomyAPI not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 144
  4. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    You may send your part of code?
    I know the error
  5. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    Ok this is a code:
    PHP:
    <?php

    namespace party;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Player;
    use 
    onebone\economyapi\event\money\AddMoneyEvent;
    use 
    pocketmine\level\Position;

    class 
    Main extends PluginBase{
       
        public function 
    onEnable(){
            
    $this->getLogger()->info("laduje komemde party");
            
    $this->EconomyS $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
        }
        public function 
    onCommand(CommandSender $senderCommand $command$label, array $args){
       if(
    strtolower($command->getName()) === "party"){
          
    $sender->sendMessage("§l§aTeleportuje na §l§aDrop§l§cParty");
          
    $sender->getPlayer()->teleport(new Position(-283,110,-47));
          
    EconomyAPI::getInstance()->addMoney($player2000);
           return 
    true;
       }

    }
    }
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Add
    PHP:
    use onebone\economyapi\EconomyAPI;
  7. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    I have that error
    Code:
    Error: Undefined constant 'party\use onebone\economyapi\EconomyAPI'
    File: myzip:///partycommand.zip#src/party/Main
    Line: 9
    Type: E_ERROR
    
    THIS CRASH WAS CAUSED BY A PLUGIN
    
    Code:
    [1] <?php
    [2]
    [3] namespace party;
    [4]
    [5] use pocketmine\plugin\PluginBase;
    [6] use pocketmine\command\Command;
    [7] use pocketmine\command\CommandSender;
    [8] use pocketmine\Player;
    [9] use onebone\economyapi\EconomyAPI;
    [10] use onebone\economyapi\event\money\AddMoneyEvent;
    [11] use pocketmine\level\Position;
    [12]
    [13] class Main extends PluginBase{
    [14]    
    [15]     public function onEnable(){
    [16]         $this->getLogger()->info("laduje komemde party");
    [17]         $this->EconomyS = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
    [18]     }
    [19]     public function onCommand(CommandSender $sender, Command $command, $label, array $args){
    
    Backtrace:
    #0 (): pocketmine\Server->crashDump(boolean)
    
    PocketMine-MP version: 1.1 #0 [Protocol 40; API 1.13.1]
    Git commit: 0000000000000000000000000000000000000000
    uname -a: Linux localhost 3.4.5 #1 SMP PREEMPT Tue Jul 8 18:38:07 CST 2014 armv7l
    PHP Version: 5.6.2
    Zend version: 2.6.0
    OS : Linux, android
    
    Loaded plugins:
    ZipPluginLoader 1.1.3 by aliuly for API(s) 1.10.0
    LimitHeight 1.1 by EvolSoft for API(s) 1.11.0
    EconomyAPI 2.0.9 by onebone for API(s) 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1
    ManyWorlds 2.0.3 by aliuly for API(s) 1.10.0
    DevTools 1.10.0 by PocketMine Team for API(s) 1.3.1
    EconomySell 2.0.7 by onebone for API(s) 1.12.0
    stonegenerator 1.0.0 by  for API(s) 1.13.0
    clearchat 1.0.0 by  for API(s) 1.13.1
    
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Re-type the sentence. The space character on line 9 is not the common space character.

Share This Page

Advertisement