View Single Post
  #13  
Old 09-21-2016, 10:41 PM
Ittermat's Avatar
Ittermat Ittermat is offline
The awesomesauce
 
Join Date: Feb 2016
Location: in front of my laptop
Posts: 272
Gender: Female
Credits: 34,888
Ittermat is on a distinguished road
Default

Sorry to bug you- but I ran into another issue- (no errors though) I cant seem to get the "game over" Message to show when they run out of the Item they need to play... instead it lets them keep playing.. I did get the message to show up at one point... but they could still play the game... x.x

Help please...

PHP Code:
 <?php

class ExploreeyresgameView extends View{
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
            
$document->setTitle("<center>Hanafuda with Eyre</center>");          
$item "Sherlock Holmes Book";
$hasitem $mysidia->db->select("inventory", array("quantity"), "itemname ='{$item}' and owner='{$mysidia->user->username}'")->fetchColumn();
if(
$hasitem){
    
$document->add(new Comment("You have $hasitem {$item}!"));
}                    
   
$item_name "Sherlock Holmes Book";
$qty 1;
$item = new PrivateItem($item$mysidia->user->username);
$item->remove($qty$mysidia->user->username); 
 
            
$document->add(new Comment("<center><a href='http://atrocity.mysidiahost.com/exploreeyresgame'>Play again?</a> Or <a href='http://atrocity.mysidiahost.com/pages/view/bakenekohalloween'> Go back to the event plaza</a></center>"FALSE));  
        
            
$random rand(1,115);
            
            if(
$random && $random 20){
$document->add(new Comment("<b><center>Eyres Hand</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
                
$document->add(new Comment("<center>You lost!</center>"FALSE));
            }
            elseif(
$random >= 21 && $random <= 30){
                
$amount rand(5,20);
                
$mysidia->user->changecash($amount); 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
$document->add(new Comment("center><img src='http://pile.randimg.net/1/90/85240/Hanafuda%20ties.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85240/Hanafuda%20ties.png'></center>"FALSE));
                
$document->add(new Comment("<center>Its a Tie...I guess I'll give you some beads...<i>You got $amount Beads!</center></i>"FALSE)); 
            }
            elseif(
$random >= 31 && $random <= 40){
                
$item "Red Pirahna Toy";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
                
$document->add(new Comment("<center>Ugh! I cant lose... fine... take this <img src='http://atrocity.mysidiahost.com/picuploads/png/b5249b5da4564c210d83f7cd61de9d33.png'><b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 41 && $random <= 60){
                
$item "Red Pirahna Toy";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                           
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("<center>Take it Human thing...The <img src='http://atrocity.mysidiahost.com/picuploads/png/69680cfc5d803f9170fe6549655f7f5b.png'><b>$item</b> is yours!</center>"FALSE));
            }
            elseif(
$random >= 101 && $random <= 110){
                
$item "Red Gummy eye";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("Fine Human thing...take the treasure.. the <img src='http://atrocity.mysidiahost.com/picuploads/png/40618507daa6fe0dd5708d878139c1e4.png'><b>$item</b> belongs to you now.</center>"FALSE));
            }
            elseif(
$random >= 61 && $random <= 70){
                
$item "Halloween Kazoo";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>, FALSE"));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("Alright Human thing... you can have my uncommon <img src='http://atrocity.mysidiahost.com/picuploads/png/6cd9c65227f0ae199cf399f294c1acb1.png'> <b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 71 && $random <= 75){
                
$item "Jar of Halloween spirit";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("No...not my rare <img src=http://atrocity.mysidiahost.com/picuploads/png/63388ceaa8e021597d9af37977138554.png'> <b>$item</b>!Human thing you are unfair!</center>"FALSE));
            }
            elseif(
$random >= 76 && $random <= 80){
                
$item "Mystery candy";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyres Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("Fine human thing....take my <img src='http://atrocity.mysidiahost.com/picuploads/png/282ad92a5ac391066e7e1999809f39ab.png'> <b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 81 && $random <= 90){
                
$item "Zombie arm";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("This is why I hate Human things... they always take my <img src='http://atrocity.mysidiahost.com/picuploads/png/856746dbbefc14049ea9d29bf86049a7.png'><b>$item</b>!</center>"FALSE));
            }
            elseif(
$random >= 111 && $random <= 115){
                
$item "Halloween Treat basket";
                
$qty 1;
                
$newitem = new StockItem($item);
                
$newitem->append($qty$mysidia->user->username);
                 
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/8a513071bd47ab3361b61942118f8b87.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));  
                
$document->add(new Comment("Alright alright...the <img src='http://atrocity.mysidiahost.com/picuploads/png/6282ede37f0ccc934ea7336751740ccc.png'> <b>$item</b> is yours.</center>"FALSE));
            }
            elseif(
$random >= 91 && $random <= 99){
                 
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));  
                
$document->add(new Comment("You lose Human thing!</center>"FALSE));
            }
            elseif(
$random == 100){
                
$document->add(new Comment("<b><center>Eyre's Hand.</center></b>"FALSE));
                
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/291a4c3f9d34e71b1a97ba1ea41a2476.png'>"));
  
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85238/Hanafuda%20winners.png'></center>"FALSE));
$document->add(new Comment("<b><center>Your Hand.</center></b>"FALSE));
$document->add(new Comment("<center><img src='http://pile.randimg.net/1/90/85239/Hanafuda%20losers.png'></center>"FALSE));  
                
$document->add(new Comment("You lose Human thing!</center>"FALSE));
            }
             else {
    
$document->add(new Comment("<center><img src='http://atrocity.mysidiahost.com/picuploads/png/b30c16d80645c40477b2143fae5f5eeb.png'></center>"FALSE));
    
$document->add(new Comment("<center>You are out of candy...come back when you have more!!</center>"FALSE));
}   
    }
   } 
?>
I cant get the "you ran out of candy" message to appear when they run out of the item they need to play...

Last edited by Ittermat; 09-22-2016 at 11:08 AM.
Reply With Quote