· 9 years ago · Jan 24, 2017, 07:18 PM
1# Database Configuration
2script options:
3 $ init com.mysql.jdbc.Driver
4 $ db url jdbc:mysql://localhost:3306/database
5 $ db username user
6 $ db password pass
7options:
8# Intialization Configuration
9 PerKill_Elo_Min:12
10 PerKill_Elo_Max:23
11
12 PerDeath_Elo_Min:24
13 PerDeath_Elo_Max:32
14
15 FirstJoin_Elo:100
16# Message Configuration
17 Admin-Set_Elo_Message:&b&l[BattleElo]&f You have set %arg-3%'s elo to %arg-2%
18 Admin-Reset_Elo_Message:&b&l[BattleElo]&f You have reset %arg-3%'s elo
19
20command /eloadmin [<text>] [<integer>] [<offline player>]:
21 permission: elo.admin
22 trigger:
23 if arg-1 is "set":
24 if arg-2 is set:
25 set {elo.%arg-3%} to arg-2
26 update "UPDATE battleelo SET elo = (""%{elo.%arg-3%}%"") WHERE name = ""%arg-3%""
27 send "{@Admin-Set_Elo_Message}"
28 stop
29 if arg-1 is "reset":
30 if arg-2 is "player":
31 delete {elo.%arg-3%}
32 update "UPDATE battleelo SET elo = (""0"") WHERE name = ""%arg-3%""
33 send "{@Admin-Reset_Elo_Message}"
34 stop
35command /elo:
36 trigger:
37 set {_elo} to the first element out of objects in column "elo" from result of query "SELECT `elo` FROM `battleelo` WHERE `uuid` = ""%uuid of player%""" and close
38 send "&b&lBattleElo - &f&l%{_elo}%"
39 stop
40on load:
41 send "&e&l[BattleElo] &fPlugins Enabled. Thanks for using the plugins develop by Oskang09" to console
42 update "create table IF NOT EXISTS battleelo (ID int NOT NULL AUTO_INCREMENT,uuid varchar(70),name varchar(70),elo varchar(20));"
43
44on first join:
45 set {elo.%player%} to {@FirstJoin_Elo}
46 update "INSERT INTO `battleelo` (`uuid`, `name`, `elo`) VALUES (""%uuid.of player%"", ""%player%"", ""%{elo.%player%}%"");"
47
48on death of a player:
49 if attacker is player:
50 add random integer from {@PerKill_Elo_Min} to {@PerKill_Elo_Max} to {elo.%attacker%}
51 remove random integer from {@PerDeath_Elo_Min} to {@PerDeath_Elo_Max} from {elo.%victim%}
52 update "UPDATE battleelo SET elo = (""%{elo.%attacker%}%"") WHERE name = ""%attacker%""
53 update "UPDATE battleelo SET elo = (""%{elo.%victim%}%"") WHERE name = ""%victim%""
54 stop