[wap] Rock-paper-scissors For Lavalair

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    its cool game but anyone having it in html version

    Comment


      #17
      <div class='quotetop'>QUOTE (johnny @ Jan 10 2009, 10:03 AM) <{POST_SNAPBACK}></div>
      its cool game but anyone having it in html version[/b]
      if you mean Xhtml..
      it takes MAX 10 minutes to convert it...
      if you got smoke brake inbetween...
      It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
      ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
      ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
      キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

      Comment


        #18
        i added this for xhtml but in this shoot option dont work in xhtml so need a bit help n hoow must i add game in fun menu</br><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
        include("config.php");
        include("core.php");
        connectdb();
        $action=$_GET["action"];
        $id=$_GET["id"];
        $sid = $_GET["sid"];
        $rid=$_GET["rid"];
        $rpw=$_GET["rpw"];
        $brws = explode(" ",$HTTP_USER_AGENT);
        $ubr = $brws[0];
        $uip = getip();
        $who = $_GET["who"];

        $uid = getuid_sid($sid);

        echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
        echo "<head>\n";
        echo "<title>FriendsZone</title>";
        echo "<meta http-equiv=\"Cache-Control\" content=\"max-age=0\">\n";

        $thid = mysql_fetch_array(mysql_query("SELECT thid FROM ibwf_mypage WHERE uid=&#39;".$uid."&#39;"));
        if($thid[0]==""||$thid[0]==0)$thid[0]=1;
        $thinfo = mysql_fetch_array(mysql_query("SELECT bgc, txc, lnk, hdc, hbg FROM ibwf_themes WHERE id=&#39;".$thid[0]."&#39;"));
        echo "<style type=\"text/css\">";
        echo "body {background-color:#$thinfo[0]; color:#$thinfo[1]}";
        echo "h3 {background-color:#$thinfo[4]; color:#$thinfo[3]}";
        echo "a:link {color:#$thinfo[2]}";
        echo "a:visited {color:#$thinfo[2]}";
        echo "</style>";

        echo "</head>\n";
        echo "<body>\n";


        $bcon = connectdb();
        if (!$bcon)
        {
        echo "<img src=\"../images/exit.gif\" alt=\"*\"/>
        ";
        echo "ERROR! cannot connect to database

        ";
        echo "This error happens usually when backing up the database, please be patient, The site will be up any minute

        ";
        echo "you can temperoray be in this site <a href=\"http://chatheaven.wen.ru\">$site_name</a> while $site_name is offline
        ";
        echo "THANK YOU VERY MUCH";
        echo "</p>";
        echo "</html>";
        echo "</body>";
        exit();
        }
        $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
        $ubr = $brws[0];
        $uip = getip();
        $action = $_GET["action"];
        $sid = $_GET["sid"];
        $page = $_GET["page"];
        $who = $_GET["who"];


        $uid = getuid_sid($sid);

        connectdb();


        //clearnc();
        $action=$_GET["action"];
        $id=$_GET["id"];
        $sid = $_GET["sid"];
        $botid = "eeb070e74e366473";
        $input = $_POST["input"];
        $custid=$_POST["custid"];
        $hostname = "www.pandorabots.com";
        $hostpath = "/pandora/talk-xml";
        if(islogged($sid)==false)
        {
        echo "<p align=\"center\">";
        echo "You are not logged in
        ";
        echo "Or Your session has been expired

        ";
        echo "<a href=\"index.php\">Login</a>";
        echo "</p>";
        echo "</body>";
        echo "</html>";
        exit();
        }
        $uid = getuid_sid($sid);
        if(isbanned($uid))
        {
        echo "<p align=\"center\">";
        echo "<img src=\"images/notok.gif\" alt=\"x\"/>
        ";
        echo "You are Banned
        ";
        $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
        $remain = $banto[0]- time();
        $rmsg = gettimemsg($remain);
        echo "Time to finish your penalty: $rmsg

        ";
        //echo "<a href=\"index.php\">Login</a>";
        echo "</p>";
        echo "</body>";
        echo "</html>";
        exit();
        }
        function canplay_rps($uid)
        {

        $sql = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        if($sql[0]>=15)
        {
        return true;
        }else{
        return false;
        }
        }

        function gup($uid)
        {
        $sql = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        return $sql[0];
        }

        function get_winner($x,$y)
        {
        if($x==1&&$y==2)
        {
        $win = 2;
        }else if($x==1&&$y==3)
        {
        $win = 1;
        }else if($x==2&&$y==1)
        {
        $win = 1;
        }else if($x==3&&$y==1)
        {
        $win = 2;
        }else if($x==2&&$y==3)
        {
        $win = 2;
        }else if($x==3&&$y==2)
        {
        $win = 1;
        }else{
        $win = 0;
        }

        return $win;
        }

        function get_left($x)
        {
        switch($x)
        {
        case 1:
        $ret = &#39;rock_l&#39;;
        break;
        case 2:
        $ret = &#39;paper_l&#39;;
        break;
        case 3:
        $ret = &#39;scissor_l&#39;;
        break;
        }
        return $ret;
        }

        function get_right($x)
        {
        switch($x)
        {
        case 1:
        $ret = &#39;rock_r&#39;;
        break;
        case 2:
        $ret = &#39;paper_r&#39;;
        break;
        case 3:
        $ret = &#39;scissor_r&#39;;
        break;
        }
        return $ret;
        }

        if(!$bcon)
        {
        echo &#39;<card id="main" title="Database Error">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/notok.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;Database Connection Error, please try again later!&#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        echo &#39;</html>&#39;;
        exit();
        }

        if(!islogged($sid))
        {
        echo &#39;<card id="main" title="Login Error">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/notok.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;You are not logged in or your session has expired!&#39;;
        echo &#39;
        &#39;;
        echo &#39;Login&#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        echo &#39;</html>&#39;;
        exit();
        }

        if(isbanned($uid))
        {
        echo &#39;<card id="main" title="Login Error">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/notok.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;&#39;;
        echo &#39;You are Banned
        &#39;;
        echo &#39;
        &#39;;
        $sql = "SELECT timeto, pnreas, exid
        FROM ibwf_parusa
        WHERE uid=&#39;".$uid."&#39;
        AND penalty=&#39;1&#39; OR uid=&#39;".$uid."&#39;
        AND penalty=&#39;2&#39;
        ";
        $banto = mysql_fetch_array(mysql_query($sql));
        $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        $remain = $banto[0] - time();
        $rmsg = gettimemsg($remain);
        echo &#39;Time Left: &#39;.$rmsg.&#39;&#39;;
        echo &#39;
        &#39;;
        $nick = getnick_uid($banto[2]);
        echo &#39;By: &#39;.$nick.&#39;&#39;;
        echo &#39;
        &#39;;
        echo &#39;Reason: &#39;.$banto[1].&#39;&#39;;
        echo &#39;
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        echo &#39;</html>&#39;;
        exit();
        }

        if(!canplay_rps($uid))
        {
        echo &#39;<card id="main" title="Error">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/notok.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;You must have atleast 15 plusses to play Rock-Paper-Scissors!&#39;;
        echo &#39;
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        echo &#39;</html>&#39;;
        exit();
        }

        if($action==&#39;play&#39;)
        {
        echo &#39;<card id="main" title="Rock-Paper-Scissors">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/rockps.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;Call: &#39;;
        echo &#39;<select name="op">&#39;;
        echo &#39;<option value="1">Rock</option>&#39;;
        echo &#39;<option value="2">Paper</option>&#39;;
        echo &#39;<option value="3">Scissors</option>&#39;;
        echo &#39;</select>&#39;;
        echo &#39;
        &#39;;
        echo &#39;<anchor>[Shoot]<go href="rps.php?action=go&amp;sid=&#39;.$sid.&#39;" method="post">&#39;;
        echo &#39;<postfield name="op" value="$(op)"/>&#39;;
        echo &#39;<postfield name="init" value="1"/>&#39;;
        echo &#39;</go></anchor>&#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        }else if($action==&#39;go&#39;)
        {
        if(isset($_POST[&#39;init&#39;])&&$_POST[&#39;init&#39;]==1)
        {
        $op = $_POST[&#39;op&#39;];
        $ac = rand(1,3);
        $res = get_winner($op,$ac);
        $_SESSION[&#39;turn&#39;] = isset($_SESSION[&#39;turn&#39;]) ? $_SESSION[&#39;turn&#39;] : 1;
        $turn = $_SESSION[&#39;turn&#39;];
        $imgl = get_left($op);
        $imgr = get_right($ac);
        $_SESSION[&#39;w&#39;] = isset($_SESSION[&#39;w&#39;]) ? $_SESSION[&#39;w&#39;] : 0;
        $_SESSION[&#39;l&#39;] = isset($_SESSION[&#39;l&#39;]) ? $_SESSION[&#39;l&#39;] : 0;
        $_SESSION[&#39;d&#39;] = isset($_SESSION[&#39;d&#39;]) ? $_SESSION[&#39;d&#39;] : 0;



        echo &#39;<card id="main" title="Rock-Paper-Scissors">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/rockps.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;[img]images/&#39;.$imgl.&#39;.png[/img][img]images/vs.png[/img][img]images/&#39;.$imgr.&#39;.png[/img]&#39;;
        echo &#39;
        &#39;;
        if($res==1)
        {
        $_SESSION[&#39;w&#39;]++;
        echo &#39;You Won!&#39;;
        echo &#39;
        &#39;;
        }else if($res==2)
        {
        $_SESSION[&#39;l&#39;]++;
        echo &#39;You Lost!&#39;;
        echo &#39;
        &#39;;
        }else{
        $_SESSION[&#39;d&#39;]++;
        $_SESSION[&#39;turn&#39;]--;
        echo &#39;Draw!&#39;;
        echo &#39;
        &#39;;
        }
        echo &#39;
        &#39;;
        if($_SESSION[&#39;turn&#39;]<3)
        {
        echo &#39;Call: &#39;;
        echo &#39;<select name="op">&#39;;
        echo &#39;<option value="1">Rock</option>&#39;;
        echo &#39;<option value="2">Paper</option>&#39;;
        echo &#39;<option value="3">Scissors</option>&#39;;
        echo &#39;</select>&#39;;
        echo &#39;
        &#39;;
        echo &#39;<anchor>[Shoot]<a href="rps.php?action=go&amp;sid=&#39;.$sid.&#39;" method="post">&#39;;
        echo &#39;<postfield name="op" value="$(op)"/>&#39;;
        echo &#39;<postfield name="init" value="1"/>&#39;;
        echo &#39;</go></anchor>&#39;;
        $_SESSION[&#39;turn&#39;]++;
        }else{
        echo &#39;&#39;.$_SESSION[&#39;w&#39;].&#39;:&#39;.$_SESSION[&#39;l&#39;].&#39;&#39;;
        echo &#39;
        &#39;;
        echo &#39;
        &#39;;
        $xup = gup($uid);
        if($_SESSION[&#39;w&#39;]>$_SESSION[&#39;l&#39;])
        {
        $plus = $xup + 15;
        $add = mysql_query("UPDATE ibwf_users SET plusses=&#39;".$plus."&#39; WHERE id=&#39;".$uid."&#39;");
        if($add)
        {
        echo &#39;You Won: $15&#39;;
        echo &#39;
        &#39;;
        echo &#39;You Plusses: &#39;.$plus.&#39;&#39;;
        }
        }
        if($_SESSION[&#39;w&#39;]<$_SESSION[&#39;l&#39;]){
        $plus = $xup - 15;
        if($plus<0)
        {
        $plus = 0;
        }
        $min = mysql_query("UPDATE ibwf_users SET plusses=&#39;".$plus."&#39; WHERE id=&#39;".$uid."&#39;");
        if($min)
        {
        echo &#39;You Lost: $15&#39;;
        echo &#39;
        &#39;;
        echo &#39;You Plusses: &#39;.$plus.&#39;&#39;;
        }
        }

        unset($_SESSION[&#39;turn&#39;]);
        unset($_SESSION[&#39;w&#39;]);
        unset($_SESSION[&#39;l&#39;]);
        unset($_SESSION[&#39;d&#39;]);

        echo &#39;
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;Play Again&#39;;
        echo &#39;
        &#39;;

        }
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;

        }else{
        echo &#39;<card id="main" title="Rock-Paper-Scissors">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/rockps.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;Do not try to cheat here!!!&#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        }
        }else{
        echo &#39;<card id="main" title="Rock-Paper-Scissors">&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;[img]images/rockps.gif[/img]&#39;;
        echo &#39;
        &#39;;
        echo &#39;Think you can outmatch [bot name] at Rock Paper Scissors? Well wage 15 plusses with a payout to match to find out. The best 2 out of 3 wins!!&#39;;
        echo &#39;
        &#39;;
        echo &#39;If you think you got what it takes, click below:&#39;;
        echo &#39;
        &#39;;
        echo &#39;Play Now&#39;;
        echo &#39;</p>&#39;;
        echo &#39;<p align="center">&#39;;
        echo &#39;<a href="index.php?action=funm&amp;sid=&#39;.$sid.&#3 9;">[img]images/roll.gif[/img]&#39;;
        echo &#39;Fun Menu</a>
        &#39;;
        echo &#39;
        &#39;;
        echo &#39;<a href="index.php?action=main&amp;sid=&#39;.$sid.&#3 9;">[img]images/home.gif[/img]&#39;;
        echo &#39;Home</a>
        &#39;;
        echo &#39;</p>&#39;;
        echo &#39;</card>&#39;;
        }

        echo &#39;</html>&#39;;

        ?></div>

        Comment


          #19
          For the ppl asking for xhtml version. u need to add ur own stylesheet though

          PHP Code:
          <?php

          /**
          * @Copyright wizard <mc_jayrulez@yahoo.com.au>
          * @File: rps.php
          * @param: $sid
          */
          session_start();
          header('Content-type: text/html');

          echo 
          '<?xml version="1.0" encoding="utf-8"?>';
          echo 
          '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
          echo 
          '<html xmlns="http://www.w3.org/1999/xhtml">';

          function 
          head($title='Rock-Paper-Scissors')
          {
              echo 
          '
              <head>
                  <title>'
          .$title.'</title>
                  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
                  <link rel="stylesheet" href="style.css" type="text/css"/>
              </head>
              <body>
                  '
          ;
          }


          include(
          "config.php");

          include(
          "core.php");

          $bcon   connectdb();
          $sid    $_GET['sid'];
          $uid    getuid_sid($sid);

          $action $_GET['action'];

          function 
          canplay_rps($uid)
          {
              
          $sql mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
              if(
          $sql[0]>=15)
              {
                  return 
          true;
              }else{
                  return 
          false;
              }
          }

          function 
          gup($uid)
          {
              
          $sql mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
              return 
          $sql[0];
          }

          function 
          get_winner($x,$y)
          {
              if(
          $x==1&&$y==2)
              {
                  
          $win 2;
              }else if(
          $x==1&&$y==3)
              {
                  
          $win 1;
              }else if(
          $x==2&&$y==1)
              {
                  
          $win 1;
              }else if(
          $x==3&&$y==1)
              {
                  
          $win 2;
              }else if(
          $x==2&&$y==3)
              {
                  
          $win 2;
              }else if(
          $x==3&&$y==2)
              {
                  
          $win 1;
              }else{
                  
          $win 0;
              }
              
              return 
          $win;
          }

          function 
          get_left($x)
          {
              switch(
          $x)
              {
                  case 
          1:
                      
          $ret 'rock_l';
                  break;
                  case 
          2:
                      
          $ret 'paper_l';
                  break;
                  case 
          3:
                      
          $ret 'scissor_l';
                  break;
              }
              return 
          $ret;
          }

          function 
          get_right($x)
          {
              switch(
          $x)
              {
                  case 
          1:
                      
          $ret 'rock_r';
                  break;
                  case 
          2:
                      
          $ret 'paper_r';
                  break;
                  case 
          3:
                      
          $ret 'scissor_r';
                  break;
              }
              return 
          $ret;
          }

          if(!
          $bcon)
          {
              
          head('Database Error');
              echo 
          '<p align="center">';
              echo 
          '[img]images/notok.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          'Database Connection Error, please try again later!';
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
              echo 
          'Fun Menu</a>';
              echo 
          '
          '
          ;
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
              echo 
          '</html>';
              exit();
          }

          if(!
          islogged($sid))
          {
              
          head('Login Error');
              echo 
          '<p align="center">';
              echo 
          '[img]images/notok.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          'You are not logged in or your session has expired!';
              echo 
          '
          '
          ;
              echo 
          'Login';
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
              echo 
          '</html>';
              exit();
          }

          if(
          isbanned($uid))
          {
              
          head('Login Error');
              echo 
          '<p align="center">';
              echo 
          '[img]images/notok.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          '';
              echo 
          'You are Banned
          '
          ;
              echo 
          '
          '
          ;
              
          $sql    "SELECT timeto, pnreas, exid 
                         FROM ibwf_parusa 
                         WHERE uid='"
          .$uid."' 
                         AND penalty='1' OR uid='"
          .$uid."' 
                         AND penalty='2'
                        "
          ;
              
          $banto  mysql_fetch_array(mysql_query($sql));
              
          $banres mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
              
          $remain $banto[0] - time();
              
          $rmsg   gettimemsg($remain);
              echo 
          'Time Left: '.$rmsg.'';
              echo 
          '
          '
          ;
              
          $nick getnick_uid($banto[2]);
              echo 
          'By: '.$nick.'';
              echo 
          '
          '
          ;
              echo 
          'Reason: '.$banto[1].'';
              echo 
          '';
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
              echo 
          '</html>';
              exit();
          }

          if(!
          canplay_rps($uid))
          {
              
          head('Error');
              echo 
          '<p align="center">';
              echo 
          '[img]images/notok.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          'You must have atleast 15 plusses to play Rock-Paper-Scissors!';
              echo 
          '
          '
          ;
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
              echo 
          'Fun Menu</a>';
              echo 
          '
          '
          ;
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
              echo 
          '</html>';
              exit();
          }

          if(
          $action=='play')
          {
              
          head();
              echo 
          '<p align="center">';
              echo 
          '[img]images/rockps.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          '<form action="rps.php?action=go&amp;sid='.$sid.'" method="post">';
              echo 
          'Call: ';
              echo 
          '<select name="op">';
              echo 
          '<option value="1">Rock</option>';
              echo 
          '<option value="2">Paper</option>';
              echo 
          '<option value="3">Scissors</option>';
              echo 
          '</select>';
              echo 
          '
          '
          ;
              echo 
          '<input type="hidden" name="init" value="1"/>';
              echo 
          '<input type="submit" value="Shoot"/>';
              echo 
          '</form>';
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
              echo 
          'Fun Menu</a>';
              echo 
          '
          '
          ;
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
          }else if(
          $action=='go')
          {
              if(isset(
          $_POST['init'])&&$_POST['init']==1)
              {
                  
          $op               $_POST['op'];
                  
          $ac               rand(1,3);
                  
          $res              get_winner($op,$ac);
                  
          $_SESSION['turn'] = isset($_SESSION['turn']) ? $_SESSION['turn'] : 1;
                  
          $turn             $_SESSION['turn'];
                  
          $imgl             get_left($op);
                  
          $imgr             get_right($ac);        
                  
          $_SESSION['w']    = isset($_SESSION['w']) ? $_SESSION['w'] : 0;
                  
          $_SESSION['l']    = isset($_SESSION['l']) ? $_SESSION['l'] : 0;
                  
          $_SESSION['d']    = isset($_SESSION['d']) ? $_SESSION['d'] : 0;
                  


                  
          head();
                  echo 
          '<p align="center">';
                  echo 
          '[img]images/rockps.gif[/img]';
                  echo 
          '
          '
          ;
                  echo 
          '[img]images/'.$imgl.'.png[/img][img]images/vs.png[/img][img]images/'.$imgr.'.png[/img]';
                  echo 
          '
          '
          ;
                  if(
          $res==1)
                  {
                      
          $_SESSION['w']++;
                      echo 
          'You Won!';
                      echo 
          '
          '
          ;
                  }else if(
          $res==2)
                  {
                      
          $_SESSION['l']++;
                      echo 
          'You Lost!';
                      echo 
          '
          '
          ;
                  }else{
                      
          $_SESSION['d']++;
                      
          $_SESSION['turn']--;
                      echo 
          'Draw!';
                      echo 
          '
          '
          ;
                  }
                  echo 
          '
          '
          ;
                  if(
          $_SESSION['turn']<3)
                  {
                      echo 
          '<form action="rps.php?action=go&amp;sid='.$sid.'" method="post">';
                      echo 
          'Call: ';
                      echo 
          '<select name="op">';
                      echo 
          '<option value="1">Rock</option>';
                      echo 
          '<option value="2">Paper</option>';
                      echo 
          '<option value="3">Scissors</option>';
                      echo 
          '</select>';
                      echo 
          '
          '
          ;
                      echo 
          '<input type="hidden" name="init" value="1"/>';
                      echo 
          '<input type="submit" value="Shoot"/>';
                      echo 
          '</form>';
                      
          $_SESSION['turn']++;
                  }else{
                      echo 
          ''.$_SESSION['w'].':'.$_SESSION['l'].'';
                      echo 
          '
          '
          ;
                      echo 
          '
          '
          ;
                      
          $xup gup($uid);
                      if(
          $_SESSION['w']>$_SESSION['l'])
                      {
                          
          $plus $xup 15;
                          
          $add mysql_query("UPDATE ibwf_users SET plusses='".$plus."' WHERE id='".$uid."'");
                          if(
          $add)
                          {
                              echo 
          'You Won: $15';
                              echo 
          '
          '
          ;
                              echo 
          'You Plusses: '.$plus.'';
                          }
                      }
                      if(
          $_SESSION['w']<$_SESSION['l']){
                          
          $plus $xup 15;
                          if(
          $plus<0)
                          {
                              
          $plus 0;
                          }
                          
          $min mysql_query("UPDATE ibwf_users SET plusses='".$plus."' WHERE id='".$uid."'");
                          if(
          $min)
                          {
                              echo 
          'You Lost: $15';
                              echo 
          '
          '
          ;
                              echo 
          'You Plusses: '.$plus.'';
                          }
                      }
                      
                      unset(
          $_SESSION['turn']);
                      unset(
          $_SESSION['w']);
                      unset(
          $_SESSION['l']);
                      unset(
          $_SESSION['d']);
                      
                      echo 
          '
          '
          ;
                      echo 
          '
          '
          ;
                      echo 
          'Play Again';
                      echo 
          '
          '
          ;
                      
                  }
                  echo 
          '</p>';
                  echo 
          '<p align="center">';
                  echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
                  echo 
          'Fun Menu</a>';
                  echo 
          '
          '
          ;
                  echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
                  echo 
          'Home</a>';
                  echo 
          '</p>';
                  echo 
          '</body>';
                  
              }else{
                  
          head();
                  echo 
          '<p align="center">';
                  echo 
          '[img]images/rockps.gif[/img]';
                  echo 
          '
          '
          ;
                  echo 
          'Do not try to cheat here!!!';
                  echo 
          '</p>';
                  echo 
          '<p align="center">';
                  echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
                  echo 
          'Fun Menu</a>';
                  echo 
          '
          '
          ;
                  echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
                  echo 
          'Home</a>';
                  echo 
          '</p>';
                  echo 
          '</body>';
              }
          }else{
              
          head();
              echo 
          '<p align="center">';
              echo 
          '[img]images/rockps.gif[/img]';
              echo 
          '
          '
          ;
              echo 
          'Think you can outmatch [bot name] at Rock Paper Scissors? Well wage 15 plusses with a payout to match to find out. The best 2 out of 3 wins!!';
              echo 
          '
          '
          ;
              echo 
          'If you think you got what it takes, click below:';
              echo 
          '
          '
          ;
              echo 
          'Play Now';
              echo 
          '</p>';
              echo 
          '<p align="center">';
              echo 
          '<a href="index.php?action=funm&amp;sid='.$sid.'">[img]images/roll.gif[/img]';
              echo 
          'Fun Menu</a>';
              echo 
          '
          '
          ;
              echo 
          '<a href="index.php?action=main&amp;sid='.$sid.'">[img]images/home.gif[/img]';
              echo 
          'Home</a>';
              echo 
          '</p>';
              echo 
          '</body>';
          }

          echo 
          '</html>';

          ?>
          Last edited by metulj; 09.08.09, 06:35. Reason: adding [ php ] ... [ / php ] tag

          Comment


            #20
            It can be coded in short by applying some maths in it like
            Code:
            <?php
            /*****************
            Rock , Paper , Scissors Game
            By
            DNS
            [url]http://forum.wapfuns.com[/url]
            ******************/
            $choice = $_POST["choice"];
            if($choice!="")
            {
            $select = array ("Rock" , "Paper" , "Scissors");
            $computer = rand(0,2);
            echo "You chose $select[$choice] .
            ";
            echo "Computer chose $select[$computer] .
            ";
            $result = $choice - $computer;
            
            if($result == 1 || $result == -2)
            {
            echo "You Win :)";
            }
            else if($result==0)
            {
            echo "Draw !";
            }
            else
            {
            echo "You lose :(";
            }
            exit();
            }
            ?>
            <html>
            <head><title> Rock Paper Scissors Game By DNS</title></head>
            <body>
            Choose
            
            <form action ="<?php $PHP_SELF;?>" method="post">
            <select name ="choice">
            <option value ="0" selected>Rock</option>
            <option value ="1">Paper</option>
            <option value ="2">Scissors</option>
            </select>
            <input type="submit" value="Play">
            </form>
            </body>
            </html>

            Comment


              #21
              <div class='quotetop'>QUOTE (rukiya @ Jan 11 2009, 05:43 AM) <{POST_SNAPBACK}></div>
              It can be coded in short by applying some maths in it like
              Code:
              <?php
              /*****************
              Rock , Paper , Scissors Game
              By
              DNS
              [url]http://forum.wapfuns.com[/url]
              ******************/
              $choice = $_POST["choice"];
              if($choice!="")
              {
              $select = array ("Rock" , "Paper" , "Scissors");
              $computer = rand(0,2);
              echo "You chose $select[$choice] .
              ";
              echo "Computer chose $select[$computer] .
              ";
              $result = $choice - $computer;
              
              if($result == 1 || $result == -2)
              {
              echo "You Win :)";
              }
              else if($result==0)
              {
              echo "Draw !";
              }
              else
              {
              echo "You lose :(";
              }
              exit();
              }
              ?>
              <html>
              <head><title> Rock Paper Scissors Game By DNS</title></head>
              <body>
              Choose
              
              <form action ="<?php $PHP_SELF;?>" method="post">
              <select name ="choice">
              <option value ="0" selected>Rock</option>
              <option value ="1">Paper</option>
              <option value ="2">Scissors</option>
              </select>
              <input type="submit" value="Play">
              </form>
              </body>
              </html>
              [/b]
              kool, but this works differently

              Comment


                #22
                tq fine game

                Comment


                  #23
                  Oh f.c.o.l save a lot of coding, at least make ur script neat.

                  function rpsResult($bet1,$bet2){
                  //bet1 is person dat accepts d challenge
                  if($bet1==$bet2){ return 0; }//draw
                  if(($bet1==1 && $bet2==2) || ($bet1==2 && $bet2==3) || ($bet1==3 && $bet2==1)){ return 2; }//bet1 lost, bet2 won
                  if(($bet1==1 && $bet2==3) || ($bet1==2 && $bet2==1) || ($bet1==3 && $bet2==2)){ return 1; }//bet2 lost, bet1 won
                  }

                  usage
                  betcodes
                  - 1 = paper
                  - 2 = scissors
                  - 3 = rock
                  pseudo code
                  if(rpsResult($challengedsBet,$challengersBet) == 0){ echo "RESULT TIE"; }elseif(rpsResult($challengedsBet,$challengersBet) == 1){ echo "RESULT: YOU WIN"; }elseif(rpsResult($challengedsBet,$challengersBet) == 2){ echo "RESULT: YOU LOST"; }

                  Comment

                  Working...
                  X