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

WhenKilled ? Timed Bans?

Comments in 'Plugin Development' started by Radix, Jul 17, 2015.

  1. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    I was going to go for a plugin that bans you for a certain amout of time depending on how many times you get killed! Using an array for the times.

    PHP:
    public function onPlayerDeath(PlayerDeathEvent $event){
              
    $p $event->getEntity();
              
    $m $event->getDeathMessage();
                
    $p->kick($m);
    I wanted to have an array like
    PHP:
    $time = array("30","180","1800","7200");
    Doing something like ...
    PHP:
    $p->ban("Banned for" $time[0] ."Seconds");
    Some how count the time and pardon the player? Code example needed!
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If it is an integer, express it as an integer. Why add quotes?
  3. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Im nof great with plugins! Thats why I asked for example code... Im open for suggestions
  4. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123

Share This Page

Advertisement