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

KillRate 2.1.1

Keep track of the number of kills

  1. vvzar
    Offline

    vvzar New Member

    Joined:
    Mar 21, 2015
    Posts:
    40
    Error: Call to a member function getScore() on null
    File: /KillRate_v1.2.3.phar/src/aliuly/killrate/Main
    Line: 591
    Type: E_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN: KillRate v1.2.3

    Code:
    [582] if ($score) {
    [583] $this->dbm->updateScore($perp,$vic,$score["count"]+$incr);
    [584] return $score["count"]+$incr;
    [585] }
    [586] $this->dbm->insertScore($perp,$vic,$incr);
    [587] return $incr;
    [588]
    [589] }
    [590] public function getScore($pl,$type = "points") {
    [591] $score = $this->dbm->getScore($pl->getName(),$type);
    [592] if ($score) return $score["count"];
    [593] return 0;
    [594] }
    [595]
    [596] }
    [597]
    [598]
    [599]
    [600]
    [601]
  2. Zaino60
    Offline

    Zaino60 New Member

    Joined:
    Jul 21, 2015
    Posts:
    17
    Minecraft User:
    Zainos
  3. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    How does your config.yml look like?
  4. predawnia
    Offline

    predawnia Active Member

    Joined:
    Dec 23, 2014
    Posts:
    167
    Minecraft User:
    GhostSpex
    @aliuly
    Is it possible to add a timer so that quick consecutive kills by a player does not get their points added?
    This is to prevent or limit farming points. Do you know what I mean?
  5. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Please clean up database structure maybe like player stats structure!
  6. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    - There is no messages.yml but you should be able to edit the messages. See other posts in this thread.
    - Kill Death Ratio can be calculated, so there is no real need for a separate column for that.
    - The schema as it is allows flexibility. If I would have a different column for each variable, the schema would need to be change everytime a new mob is added. Since you are using MySQL you can always do a join to get such table. For example:
    Code:
    SELECT d.player,k.count as kills, d.count as deaths
    FROM `Scores` AS k, Scores AS d
    WHERE k.type = "player"
    AND d.type = "deaths"
    AND k.player = d.player
    
    
  7. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    The Database structure does not need clean-up. It is designed to be flexible, i.e. additional categories on the fly. Player stats is not able to do that without having to modify the table.

    If you are using MySQL and getting stats for different reporting methods you can either use code to aggregate or use SQL joins as ina previous example.
  8. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Hello,

    I have a new version of KillRate that needs testing. It can be downloaded from here: https://github.com/alejandroliu/pocketmine-plugins/releases/tag/KillRate-2.0.0dev1

    Docs can be found here: https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate

    • 2.0.0: Partial rewrite
      • Fixed bug prevents scoring on creative
      • Fixed bug related to libcommon MoneyAPI (crash when no Economy loaded)
      • Dropping support for PocketMine v1.4 and lower
      • API has been revamped!
      • Included example extension
      • Added Kill/Death ratio calculations
    The interesting bit is the API which allows for creating extensions to this plugin. There is a sample extension included (or can be downloaded separately from GitHub).

    The extensions implements two previously requested features:
    • command: /krgive {player} {points} (Requested by @Daniel123)
    • Also has a "level" implementation (Requested by multiple people, the implementation is based on an idea from @SeangJemmy)
  9. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    aliuly updated KillRate with a new update entry:

    2.0.0: Partial rewrite

    Read the rest of this update entry...
  10. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    This latest update comes with an example script plugin in its data directory that implements a common requested feature on how to implement player levels.

    I am still writing the documentation but if you are adventurous you can start playing with it already.
  11. rock2rap
    Offline

    rock2rap New Member

    Joined:
    Aug 23, 2013
    Posts:
    48
    Minecraft User:
    Williams
    '# values': configure awards. (1st.money, 2nd.points)
    values:
    '*':
    - 1
    - 10
    Player:
    - 5
    - 30
    - 50

    1st = values ?
    2nd = Player?
    is a Random?
  12. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Your question has been asked (and answered) in this thread before:
    Code:
    '# values': configure awards.
    values:
      '*':
      - 1
      - 1
      Player:
      - 10
      - 2
      <Example>:
      - money
      - points
    
    The "*" is the default entity. "Player" is for players. You can have other entities being scored upon, like Chicken, Zombie, etc...
    rock2rap likes this.
  13. rock2rap
    Offline

    rock2rap New Member

    Joined:
    Aug 23, 2013
    Posts:
    48
    Minecraft User:
    Williams
    I not sure about Point requirement to up level

    i need to modify

    lv0 = 0
    lv1 = 500
    lv2 = 1500
    lv3 = 4000

    How to show ur example config?
  14. rock2rap
    Offline

    rock2rap New Member

    Joined:
    Aug 23, 2013
    Posts:
    48
    Minecraft User:
    Williams
    Oh It's make to die haha
  15. Tolo
    Offline

    Tolo Active Member

    Joined:
    Jul 2, 2015
    Posts:
    116
    Minecraft User:
    Tolo
    I'm also wondering how I can change the amount of points needed to rank up. Where's the config for it?
  16. rock2rap
    Offline

    rock2rap New Member

    Joined:
    Aug 23, 2013
    Posts:
    48
    Minecraft User:
    Williams
    an KillRateEx.php convert to .phar?
  17. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Because there are too many possibilities, I decided to implement this as a script plugin, so all these things can be changed directly from the code.
  18. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Just copy KillRateEx.php to your plugins folder. No need to convert to .phar. Otherwise you can use @PEMapModder phar generator stuff.
  19. Tolo
    Offline

    Tolo Active Member

    Joined:
    Jul 2, 2015
    Posts:
    116
    Minecraft User:
    Tolo
    I'm new to coding. So have no idea how to do that lol. Any chance u could add the rank up system to the plugin and add a config to change the points needed per rank?.
  20. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    You need to modify "KillRateEx.php". Replace the line:
    PHP:
    $threshold = ($clevel 1) * ($clevel 1) * 1000;
    With this text:

    PHP:
    switch ($clevel+1) {
    case 
    0$threshold 0; break; // For Info only as this never happens...
    case 1$threshold 500; break;
    case 
    2$threshold 1500; break;
    case 
    3$threshold 4000; break;
    default: 
    $threshold 100000; break;
    }
    BTW, the example uses "lvl" as the prefix. You are welcome to change that, but then you need to be careful how that is referenced to.

Share This Page

Advertisement