1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

help me if(($d < 6) || (-6 > $d < 0)){} not work

Discussion in 'Development' started by TheStepKla, Mar 22, 2020.

  1. TheStepKla

    TheStepKla Silverfish

    Messages:
    20
    Hi help plese
    Code:
    if(($d < 6) || (-6 > $d < 0)){}
    notwork help me
    my logs
    Code:
    2020-03-22 [18:11:40] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected '<'" (EXCEPTION) in "plugins/arrest/src/arrest/Main" at line 62
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #0 vendor/pocketmine/classloader/src/BaseClassLoader(124): BaseClassLoader->loadClass(string[11] arrest\Main)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #1 (): BaseClassLoader->{closure}(string[11] arrest\Main)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #2 (): spl_autoload_call(string[11] arrest\Main)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(165): class_exists(string[11] arrest\Main, boolean 1)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #4 src/pocketmine/plugin/PluginManager(335): pocketmine\plugin\PluginManager->loadPlugin(string[67] E:\PocketMine-MP-3.11.5 - Roleplay - ...............\plugins\arrest, array[1])
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #5 plugins/PocketMine-DevTools.phar/src/DevTools/DevTools(69): pocketmine\plugin\PluginManager->loadPlugins(string[61] E:\PocketMine-MP-3.11.5 - Roleplay - ...............\plugins\, array[1])
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #6 src/pocketmine/plugin/PluginBase(115): DevTools\DevTools->onEnable()
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #7 src/pocketmine/plugin/PluginManager(541): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #8 src/pocketmine/Server(1783): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #9 src/pocketmine/Server(1769): pocketmine\Server->enablePlugin(object DevTools\DevTools)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #10 src/pocketmine/Server(1528): pocketmine\Server->enablePlugins(integer 0)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #11 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[53] E:\PocketMine-MP-3.11.5 - Roleplay - ...............\, string[61] E:\PocketMine-MP-3.11.5 - Roleplay - ...............\plugins\)
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(296): pocketmine\server()
    2020-03-22 [18:11:40] [Server thread/DEBUG]: #13 (11): require(string[108] phar://E:/PocketMine-MP-3.11.5 - Roleplay - .............../PocketMine-MP.phar/s)
     
    Last edited: Mar 22, 2020
  2. QuiverlyRivalry

    QuiverlyRivalry Zombie Pigman

    Messages:
    491
    GitHub:
    quiverlyrivalry
    Your if statement is incorrect. Not the first bit but the second bit. Their is no feature which lets you compare stuff like this:
    2 < x < 8
    Like we do in real life.
    Instead we have to translate it into terms the computer can understand so with our example you can make it:
    (x > 2 && x < 8)
    This does the same as the statement above.
     
    GamakCZ likes this.
  3. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    Are you sure that you want to do this?
    PHP:
    if($d < -6) {}
    The result is same as in your code (but with the fix)
     
  4. TheStepKla

    TheStepKla Silverfish

    Messages:
    20
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.