Page 2 of 3

Re: Video#10

Posted: Thu Nov 12, 2009 8:07 pm
by countvoldermort
you have to copy them of the screen or ask me to give them to you...

Re: Video#10

Posted: Tue Jan 26, 2010 2:51 am
by Zerk
clicked on the zip and go
:Not Found

The requested URL /file/tutorial.zip was not found on this server.:

lol

Re: Video#10

Posted: Tue Jan 26, 2010 3:55 am
by Jackolantern
Yeah, there was kind of an issue where any files on File-Pasta were lost. I suppose they need to be re-upped.

Re: Video#10

Posted: Thu Jan 28, 2010 2:39 pm
by hallsofvallhalla
just keep going through the videos, you dont need the source yet until video 14 or so.

Re: Video#10

Posted: Sat Jan 30, 2010 6:24 am
by Zerk
Jackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).
This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lost :oops:

Went back and did vids 3-10 SLOWLY and messed around with it.^^ lol

Re: Video#10

Posted: Sat Jan 30, 2010 7:18 am
by Jackolantern
Zerk wrote:
Jackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).
This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lost :oops:

Went back and did vids 3-10 SLOWLY and messed around with it.^^ lol
Exactly. "Messing around with it" is the operative phrase there. "Getting ahead" of the videos will only cause confusion if you aren't already a seasoned PHP coder.

Re: Video#10

Posted: Sun May 06, 2012 5:26 pm
by bradders0906
The code link isnt working anymore :S, wont work on video 11 either, havent checked the ones after that, but im having a problem with my buyitem.php
this is the code:

Code: Select all

<?php
include_once 'connect.php';
session_start();
///new for video 8/////////////
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">


<?php

///////////////////////////////////

if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
  exit;
}


  $randid=$_GET['randid'];



$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);

$playerid = $playerinfo3['id'];

$iteminfo="SELECT * from store where randid='$randid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2); 

if ($playerinfo3['gold'] < $iteminfo3['price']);
(
  echo"You do not have enough gold for this purchase!";
   echo"<center><a href='index.php'>Go Back</center>";
  exit;
)


$name = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
$randid2 = rand(1000,999999999);

$itembought = "INSERT into inventory(id, name, stats, statadd, randid,type) VALUES ('$playerid','$name','$stats','$statadd','$randid2','$type')";
mysql_query($itembought) or die("could not insert item into backpack");


$updateplayer="update players set gold=gold-='$iteminfo3[price]' where name='$player'";
  mysql_query($updateplayer) or die("Could not update player");


echo $name . " Purchased";
echo "<center><a href='index.php'>Go Back</center>";
  ////did not make a - counter for item////
  
  ?>
and i keep getting this error message:

Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\game\buyitem.php on line 42

i followed the video exactly and im not sure what ive done... :( please help ASAP

Re: Video#10

Posted: Sun May 06, 2012 6:27 pm
by Jackolantern
On line 40, you use parenthesis instead of curly braces. Since you used curly braces on your other code blocks, I am assuming this was just a typo. It should be:

Code: Select all

if ($playerinfo3['gold'] < $iteminfo3['price']);
{
  echo"You do not have enough gold for this purchase!";
   echo"<center><a href='index.php'>Go Back</center>";
  exit;
} 

Re: Video#10

Posted: Sun May 06, 2012 8:09 pm
by bradders0906
hey jack, i used you code and that error has gone away, but now it always says i havent got enough gold for that purchase, no matter how much gold
i have? could you send me your entire buyitem.php please :S
Thanks

Re: Video#10

Posted: Sun May 06, 2012 8:57 pm
by Jackolantern
I don't have a buyitem.php. Sorry! This is Halls' tutorial series not mine, and I have not gone through it, as I already knew PHP. But you should be able to download Halls' source for that script. However, it should be even better if you want to one day do customization to the source if you continue to work on this and get it working. Just review all through the script every part that references the gold and see where it is going wrong.