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

sendMessage Doesnt Work

Comments in 'Plugin Development' started by Jon, Oct 6, 2014.

  1. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    They Arent empty
  2. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    I don't know where is the error. I should see the full source code.
    If I have time, I will fix the problem if you send me the source
  3. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    Ill PM you
  4. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    Tell me if this is what you are looking for.
    PS: I'm not so good in PHP so I hope I've done all corectly and remember that this is only a test plugin.

    Commands:
    /color

    Try this command in-game and after that look in the console.

    Thanks!

    Attached Files:

  5. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    And I can give you the code source for this plugin if you want...
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    <rage><?php echo strtolower("GUYS CAN YOU PLEASE GET ON-TOPIC? TWO PAGES OF DISCUSSION AND NO ONE GAVE A PROPER ANSWER TO HIM, BUT KEEPS TALKING RUBBISH ABOUT HOW TO MAKE MODS?"); ?> </rage>

    <nonrage>
    An array's structure:
    PHP:
    $array = [
        
    $key0 => $value0,
        
    $key1 => $value1
    ];
    So, what in_array($value, $array) does is check whether $value is a value in this array, i.e. whether this array has a line (called entry below) with a value $value.

    unset($array[$key]) locates the entry with the key equal to $key in the array. If there is no such element, an E_NOTICE level error/warning will be triggered.

    array_push($array, $value) pushes the value $value to the end of array. I'm not sure what key will be used for it it an array is not ordered integrally (i.e. not ordered in ascending integer order).

    In your case, you can simply change unset($array[$player->getName()]) to unset($array[array_search($player->getName(), $array)]);

    One last thing, I may be wrong in the order of parameters. Correct me please if that is the case. PHP is a mess itself :p
    (E.g. strpos($haystack, $needle) but in_array($needle, $haystack))
    </nonrage>
    PocketKiller, LDX and GlaciercreepsMC like this.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I think we are more asking for how to fix code errors rather than to get a working version here :D
    Jon likes this.
  8. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    I just want to help...
    EvolSoft likes this.
  9. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Don't worry. Helping people is the best and the right thing to do :)

Share This Page

Advertisement