Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function calcDmg($user){
- $ranks=json_decode(file_get_contents("http://e-sim.org/apiRanks.html"),true); // rangok
- $udata=json_decode(file_get_contents("http://e-sim.org/apiCitizenByName.html?name=$user"),true); //user
- $str=$udata["strength"]; // str
- $rnm=$udata["rank"]; // rang neve
- foreach($ranks as $b){ //minden rangot végignéz
- if($b["name"]==$rnm){//ha a rank neve jó
- $mod=$b["damageModifier"]; //a dmg modifiert beállítjuk
- }
- }
- echo floor($str*$mod*0.5); //Q0 kiírás
- for($i=1;$i<=5;$i++){
- echo " ".floor($str*$mod*(1+0.2*$i)); //Qi kiírás
- }
- }
- calcDmg("HELLO_WORLD");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment