-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.php
67 lines (38 loc) · 1.7 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
//example run
error_reporting(E_ALL);
include('xml.player.php');
//data path
$data = 'testbench';
//start constructor
$player = new xmlPlayer($data);
$playerName = 'Pavlus'; // we will deal with this player :)
//open both account file and player file, you can switch to other player anytime and class will aouto-close previous one
if($player->prepare($playerName) == TRUE) {
echo 'Player '.$playerName.' has been loaded <br>';
}
//check if player has finalwarning flag
$ban = $player->getBanStatus();
//display chosen argument
echo 'Finalwarning: '.$ban['finalwarning'].'<br>';
//lets see how many percent he needs for next level
echo 'He needs:'.$player->getExpPercentNextLevel().' % for next level<br><br>';
$skills = $player->getSkills();
echo 'club skill level: '.$skills['club'].'<br>';
echo 'shield skill level: '.$skills['shield'].'<br>';
//check player houses
$player->getHouses('Pavlus');
if($player->house['count'] > 0) {
echo 'Owns: '.$player->house['owner'].'<br>';
echo 'Subowns: '.$player->house['subowner'].'<br>';
echo 'Guest of: '.$player->house['guest'].'<br>';
echo 'Doorowner of: '.$player->house['doorowner'].'<br><br>';
}
//show player outfit
$image = $player->showOutfit();
?>
<img src="<?php echo $image; ?>"><br>
<?php
//show structure of xml file in class way
echo 'Struture of xml player file: <br>';
$player->showStructurePlayer();