API

====[ How use? ]====

Import the .jar in our project. (Exemple for exlipse: Right click on your project > Build Path > Configure Build Path > Libraries > Add External JARs > Choose SimpleRatio .jar)

Import the API in your class with:

import fr.plx0wn.RatioAPI;

Exemple:

packtage com.exemple.plugin
import fr.plx0wn.RatioAPI;

public class ExempleClass extends JavaPlugin {
   ... Your code.
}

The API only work if the plugin SimpleRatio run in the server.

====[ Features ]====

FeaturesUtility
getKills(Player player)Get the number of kills of a player
getDeaths(Player player)Get the number of deaths of a player
getRatio(Player player)Get the ratio of a player

Exemple:

This is my code, it's the commands /ratio

	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
	        if (sender instanceof Player) {
			Player player = (Player) sender;
			if (label.equalsIgnoreCase("ratio")) {
				        player.sendMessage(ChatColor.GREEN + "Kills: " + RatioAPI.getKills(player));
					player.sendMessage(ChatColor.GREEN + "Deaths: " + RatioAPI.getDeaths(player));
					player.sendMessage(ChatColor.GREEN + "Ratio: " + RatioAPI.getRatio(player));
			}
                }
        }

If you wan't more API send me a message.


Comments

Posts Quoted:
Reply
Clear All Quotes