HELLO_WORLD

e-sim példakód 1

Mar 29th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. function calcDmg($user){
  3. $ranks=json_decode(file_get_contents("http://e-sim.org/apiRanks.html"),true); // rangok
  4. $udata=json_decode(file_get_contents("http://e-sim.org/apiCitizenByName.html?name=$user"),true); //user
  5. $str=$udata["strength"]; // str
  6. $rnm=$udata["rank"]; // rang neve
  7. foreach($ranks as $b){ //minden rangot végignéz
  8. if($b["name"]==$rnm){//ha a rank neve jó
  9. $mod=$b["damageModifier"]; //a dmg modifiert beállítjuk
  10. }
  11. }
  12. echo floor($str*$mod*0.5); //Q0 kiírás
  13. for($i=1;$i<=5;$i++){
  14. echo " ".floor($str*$mod*(1+0.2*$i)); //Qi kiírás
  15. }
  16. }
  17. calcDmg("HELLO_WORLD");
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment