Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroliu committed Dec 5, 2016
1 parent 186900a commit 06e95c8
Show file tree
Hide file tree
Showing 11 changed files with 639 additions and 304 deletions.
212 changes: 129 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,39 @@

# KillRate

* Summary: Keep track of how much killing is going-on
* Dependency Plugins: N/A
* PocketMine-MP version: 1.4 - API 1.10.0
* Summary: Keep track of the number of kills
* PocketMine-MP version: 1.4 (API:1.10.0)
* DependencyPlugins: -
* OptionalPlugins: PocketMoney,MassiveEconomy,EconomyAPI,GoldStd
* Categories: Informational
* Plugin Access: Commands, Databases, Entities, Tile Entities
* WebSite: [github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate)
* WebSite: https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate

## Overview

Keep track on how much killing is going-on on a server.
<!-- php: $v_forum_thread = "http://forums.pocketmine.net/threads/killrate.8060/"; -->
<!-- template: prologue.md -->

**DO NOT POST QUESTION/BUG-REPORTS/REQUESTS IN THE REVIEWS**

It is difficult to carry a conversation in the reviews. If you
have a question/bug-report/request please use the
[Thread](http://forums.pocketmine.net/threads/killrate.8060/) for
that. You are more likely to get a response and help that way.

_NOTE:_

This documentation was last updated for version **1.2.3**.

Please go to
[github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate)
for the most up-to-date documentation.

You can also download this plugin from this [page](https://github.com/alejandroliu/pocketmine-plugins/releases/tag/KillRate-1.2.3).

<!-- template-end -->

This plugin keeps track on how much killing is going-on on a server.

It may optionally use an economy plugin like for example, PocketMoney,
to reward killing.
Expand All @@ -24,7 +45,20 @@ Basic Usage:
* killrate stats [player] - Show the KillRate stats for [player]
* killrate top [online] - Show top players.

You can also place signs with the following text in the first line:
You can also place signs to show game statistics.

Thanks to @Daniel123 and @CaptainKenji17 for suggestions and feedback.

## Documentation

This plugin supports PocketMoney and GoldStd and has experimental
support for MassiveEconomy and EconomyAPI.

### Signs

You can place signs showing current game statistics. The following
sign types are available by default, by entering the keyword
([KEYWORD]) in **LINE1** of the sign:

* [STATS] - Current player statistics
* [RANKINGS] - Top 3 players + scores
Expand All @@ -34,17 +68,33 @@ You can also place signs with the following text in the first line:
* [TOPNAMES] - Top 3 on-line player names
* [TOPPOINTS] - Top 3 on-line player scores

These signs will then display current statistics. These signs can be
further customized by adding the following:
Signs showing top players can be further customized by adding
additional entries in the sign text:

* LINE2 - Title, first line of the sign.
* LINE3 - What statistic to count (i.e. deaths, points, player), etc.
* LINE4 - format line, selects a format from the config.yml formats section.
* LINE2 - Title, this will be the first line of the sign. If,
however, you set it to **"^^^"** (Three consecutive **^** signs),
the title will be omitted (and the sign will show a top 4).
* LINE3 - What statistic to count. It defaults to _points_, but it
can be changed to anything (for example, _deaths_, _player_, etc).
Essentially the value here is the word on the left when you enter
the command _killrate stats_.
* LINE4 - format line, select a format out of the **config.yml**
file's **formats** section.

## Documentation
In the **formats** section you have:

This plugin supports PocketMoney and GoldStd and has experimental
support for MassiveEconomy and EconomyAPI.
```
selector: format
```

The **selector** is a word that matches the text in **LINE4** of the
sign. The format can contain any text and the following variable
substitutions:

* {player} - player's name
* {n} - rank number
* {count} - score
* {sname} - only the first 8 characters of the player's name

### Permission Nodes

Expand All @@ -58,78 +108,27 @@ support for MassiveEconomy and EconomyAPI.
* killrate.signs.use : Allow to use KillRate signs


## Configuration

These can be configured from `config.yml`:

```YAML
settings:
points: true
rewards: true
creative: false
dynamic-updates: 80
kill-streak: false or value
reset-on-death: false or value
pop-up: false
values:
zombie: [10,100]
Player: [100, 100]
'*': [0, -10]
backend: SQLiteMgr
MySQL:
host: localhost
user: nobody
password: secret
database: KillRateDb
port: 3306
signs:
'[STATS]': stats
'[RANKINGS]': rankings
'[ONLINE TOPS]': online-ranks
'[RANKNAMES]': rankings-names
'[RANKPOINTS]': rankings-points
'[TOPNAMES]': online-top-names
'[TOPPOINTS]': online-top-points
formats:
default: '{sname} {count}'
names: '{n}.{player}'
scores: '{count}'
```
If `creative` is set to true, kills done when the player is in
`creative` will be counted. The default is false, *NOT* to count
them.

If `points` is true, points are awarded and tracked. You need to
enable `points` for the rankings to work.

If `rewards` is true, money is awarded. You need an economy plugin
for this to work.

`dynamic-updates` show in tick intervals how often signs are updated.
### Configuration

`pop-up` will use the _pop up_ message to show the player's score.
Configuration is through the `config.yml` file.
The following sections are defined:

`kill-streak`: Set to `false` or to a number. Will show the kill
streak of a player.
#### config.yml

`reset-on-death`: Set to `false` or to a number. When the player dies
that number of times, scores will reset. (It is GAME OVER).
* settings: Configuration settings
* points: award points. if true points are awarded and tracked.
* rewards: award money. if true, money is awarded. Requires an economy plugin
* creative: track creative kills. if true, kills done by players in creative are scored
* dynamic-updates: Update signs. Set to 0 or false to disable, otherwise sign update frequence in ticks
* reset-on-death: Reset counters on death. set to **false** or to a number. When the player dies that number of times, scores will reset. (GAME OVER MAN!)
* kill-streak: Enable kill-streak tracking. "set to **false** or to a number. Will show the kill streak of a player once the number of kills before dying reaches number
* achievements: Enable PocketMine achievements
* values: configure awards. (1st.money, 2nd.points) Configures how many points or how much money is awarded per kill type. The first number is points, the second is money. You can use negative values.
* formats: Sign formats. Used to show sign data
* backend: Use SQLiteMgr or MySqlMgr
* MySql: MySQL settings. Only used if backend is MySqlMgr to configure MySql settings
* signs: placed signs text. These are used to configure sign texts. Place signs with the words on the left, and the sign type (on the right) will be created

`values` are used to configure how many points or how much money is
awarded per kill type. The first number is points, the second is
money. You can use negative values.

`signs` are used to configure sign texts. These texts will be used to
identify which signs should show player stats.

`formats` are used to show what data are shown in the different
signs. The following variables are available in these formats:

* {player} - player's name
* {n} - rank number
* {count} - score
* {sname} - only the first 8 characters of a name

## Translations

Expand All @@ -141,18 +140,65 @@ languages currently available are:

You can provide your own message file by creating a file called
`messages.ini` in the plugin config directory. Check
[github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate/resources/messages/)
[github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate)
for sample files.

The contents of these "ini" files are key-value pairs:

"Base text"="Translated Text"

## API

The following functions are available to get information from this
plugin:

* getRankings($limit=10,$online=false,$stat = "points")
* $limit - the number of rows to return
* $online - false, all players, true, only on-line players are
returned
* $stat - the statistic you want to display
* updateDb($player,$stat,$incr = 1)
* $player - the player you want to score
* $stat - type of statistic to update
* $incr - how many units to increase
* getScore($player,$stat = "points")
* $player - player to look-up
* $stat - statistic to return

To use the api:

```php
[PHP]
$server->getPluginManager()->getPlugin("KillRate")->function()
[/PHP]
```

## FAQ

* Q: Can you score when you push people to lava (or other indirect kills)?
* A: Only direct kills are scored. All indirect kills (pushing people
to lava, causing explosions, etc) can not be scored.

# Changes

* 1.2.3:
* MySqlMgr: Fixed typo
* Fixed bug with setting rewards/points to false (Reported by @reidq7)
* 1.2.2
* small tweaks on the comments of the config file...
* Added achievements
* 1.2.1:
* CptKenji's features:
* Double money and Best streak tracking.
* Fixed MySql support. It should work now.
* 1.2.0: Bumped the version number to reflect config changes.
* Added the "^^^" hack.
* Removed pop-up scores.
* Improved documentation
* 1.1.1:
* Minor tweaks
* Signs are more configurable
* **PLEASE DELETE OLD CONFIG.YML FILE**
* 1.1.0: General improvements
* Added experimental MySQL support
* Messages file and translations: spanish
Expand Down
3 changes: 2 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: KillRate
version: 1.1.1
version: 1.2.3
main: aliuly\killrate\Main
api: 1.10.0
load: POSTWORLD
Expand All @@ -8,6 +8,7 @@ softdepend: [PocketMoney,MassiveEconomy,EconomyAPI,GoldStd]

description: Keep track of the number of kills
author: aliuly
website: https://github.com/alejandroliu/pocketmine-plugins/tree/master/KillRate

commands:
killrate:
Expand Down
13 changes: 9 additions & 4 deletions resources/messages/messages.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
; messages.ini
"# MISSING MONEY API PLUGIN"=""
"%1%-mode"=""
"%1% beat previous streak record of %2% at %3% kills"=""
"%1% ended his kill-streak at %2% kills"=""
"%1% has a %2% kill streak"=""
"%1% points awarded!"=""
"%1% points deducted!"=""
Expand All @@ -11,8 +13,9 @@
". Player Points"=""
". Please install one of the following:"=""
"Adventure"=""
"Configuration has been changed"=""
"Creative"=""
"Feature DISABLED"=""
"It is recommended to delete old config.yml"=""
"KillRate sub-commands"=""
"Kills: "=""
"Money: "=""
Expand All @@ -24,8 +27,6 @@
"Placed [KillRate] sign"=""
"Please report bugs"=""
"Points: "=""
"Pop-ups only available on PMv1.5+"=""
"Score: %1%"=""
"Show player scores"=""
"Show top players"=""
"Spectator"=""
Expand All @@ -41,19 +42,23 @@
"Usage: /killrate %1% %2%"=""
"Using %1% as backend"=""
"Using %1% backend is untested"=""
"Using deprecated pop-up feature"=""
"Using money API from %1%"=""
"You are fined $%1%"=""
"You are fined $1"=""
"You can only do this in-game"=""
"You do not have permission to do that."=""
"You earn $%1%"=""
"You earn $1"=""
"You earn an additional $%1% for being in kill-streak!"=""
"You were killed by %1%!"=""
"one point awarded!"=""
"one point deducted!"=""
"#%1% was killed by %2%!"=""
"#Feature DISABLED"=""
"#Pop-ups only available on PMv1.5+"=""
"#Score: %1%"=""
"#Top On-Line"=""
"#Using deprecated pop-up feature"=""
"#You can only use this command in-game"=""
"#You have a %1% kill streak."=""
"#{count}"=""
Expand Down
15 changes: 10 additions & 5 deletions resources/messages/spa.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
; spa.ini
"# MISSING MONEY API PLUGIN"="# FALTA PLUGIN DE ECONOMIA"
"%1%-mode"="modo-%1%"
"%1% beat previous streak record of %2% at %3% kills"="%1% rompió su record de rachas anterior de %2% con %3% victorias."
"%1% ended his kill-streak at %2% kills"="%1% terminó su racha de victorias con %2%"
"%1% has a %2% kill streak"="%1% tiene una racha de %2% victorias"
"%1% points awarded!"="%1% puntos ganados!"
"%1% points deducted!"="%1% puntos perdidos!"
Expand All @@ -11,8 +13,9 @@
". Player Points"=". Jugador Puntos"
". Please install one of the following:"=". Por favor instale uno de estos:"
"Adventure"="Aventura"
"Configuration has been changed"="Configuración ha cambiado"
"Creative"="Creativo"
"Feature DISABLED"="Módulo DESACTIVADO"
"It is recommended to delete old config.yml"="Se recomienda borrar su config.yml anterior"
"KillRate sub-commands"="Sub-comandos de KillRate"
"Kills: "="Muertos: "
"Money: "="Dinero: "
Expand All @@ -22,10 +25,8 @@
"On-line Names"="Nombres en-línea"
"On-line Scores"="Puntajes en-línea"
"Placed [KillRate] sign"="Construyo un cartel de [KillRate]"
"Please report bugs"="Por favor reporte ERRORER"
"Please report bugs"="Por favor reporte ERRORES"
"Points: "="Puntos: "
"Pop-ups only available on PMv1.5+"="Pop-up solo disponible en PMv1.5+"
"Score: %1%"="Puntaje: %1%"
"Show player scores"="Mostrar puntajes de jugador"
"Show top players"="Mostrar los mejores jugadores"
"Spectator"="Espectador"
Expand All @@ -41,18 +42,22 @@
"Usage: /killrate %1% %2%"="Uso: /killrate %1% %2%"
"Using %1% as backend"="Usando %1% para almacenamiento"
"Using %1% backend is untested"="Uso de %1% es experimental"
"Using deprecated pop-up feature"="Usando m&oacute;dulo de pop-up obsoleto"
"Using money API from %1%"="Usando API de Economía: %1%"
"You are fined $%1%"="Eres multado %1% EUR"
"You are fined $1"="Eres multado un EUR"
"You can only do this in-game"="Solo se puede hacer esto dentro del juego"
"You do not have permission to do that."="No tienes permiso de hacer eso"
"You earn $%1%"="Haz ganado %1% EUR"
"You earn $1"="Haz ganado Un EUR"
"You earn an additional $%1% for being in kill-streak!"="Ganaste unos %1%EUR addicionales por tener un racha!"
"You were killed by %1%!"="Fue eliminado por %1%!"
"one point awarded!"="Un punto ganado!"
"one point deducted!"="Un punto perdido!"
"#%1% was killed by %2%!"="%1% fue eliminado por %2%!"
"#Feature DISABLED"="Módulo DESACTIVADO"
"#Pop-ups only available on PMv1.5+"="Pop-up solo disponible en PMv1.5+"
"#Score: %1%"="Puntaje: %1%"
"#Top On-Line"="Mejores En-Línea"
"#Using deprecated pop-up feature"="Usando módulo de pop-up obsoleto"
"#You can only use this command in-game"="Solo puedes usar esto dendro del juego"
"#You have a %1% kill streak."="Tienes una racha de %1% victorias"
Loading

0 comments on commit 06e95c8

Please sign in to comment.