Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1.     public function rollDice($username, $userid, $otherUser)
  2.     {
  3.        
  4.         $status = file_get_contents("status.txt");
  5.         if (strpos($status, 'Game: Active') !== false) {
  6.             if (!empty($otherUser) && ($this->isAuthorized($username))) {
  7.                 $username = $otherUser;
  8.                 echo "set user";
  9.             }
  10.             if (!$this->checkUserBet($username)) {
  11.                 $this->sendPM("There is currently an active game. Please try again later.", $userid);
  12.                 return;
  13.             }
  14.  
  15. // IMPORTANT SHIT HERE
  16. // IMPORTANT SHIT HERE
  17. // IMPORTANT SHIT HERE
  18.             $roll = mt_rand(1, 100);
  19.  
  20. // END IMPORTANT SHIT
  21.  
  22.             file_put_contents("rolls.txt", "$username:$roll\n", FILE_APPEND | LOCK_EX);
  23.             $this->postShout("{$username} rolls a {$roll}");
  24.             $this->postShout('/sticky [b][color=PaleGreen]' . $this->getLead() . ' is in the lead.[/color] Current players: [color=red]' . $this->getCurrentPlayers() . '[/color][/b]');
  25.             $this->gameOver();
  26.         } else {
  27.             $this->sendPM($this->roll($username), $userid);
  28.         }
  29.        
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement