Browser MMO Video #33
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Browser MMO Video #33
[youtubehd]http://www.youtube.com/watch?v=QouTCJrNPws[/youtubehd]
http://www.youtube.com/watch?v=QouTCJrNPws
http://www.youtube.com/watch?v=QouTCJrNPws
-
- Posts: 165
- Joined: Tue Oct 13, 2009 4:22 pm
Re: video 33
Hey, FIRST REPLY!!
Anyways, the whole point of this video was to get it so you could invite other player and the 'see members' thing. But when i send an invite it just sends a normal message ike in vide 32, iv checked index.php loads of time, i just cant see whats wrong!!!! Here the code:
index.php
Reply ASAP please
Anyways, the whole point of this video was to get it so you could invite other player and the 'see members' thing. But when i send an invite it just sends a normal message ike in vide 32, iv checked index.php loads of time, i just cant see whats wrong!!!! Here the code:
index.php
Code: Select all
<?php
include_once 'connect.php';
session_start();
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;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$bypass = 0;
include_once 'statpanel.php';
?>
<div id ="locations">
<?php
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
{
echo "You are dead!" ;
echo "<br><a href='useitem.php'>Use an Item";
exit;
}
if(isset($_GET['map']))
{
$bypass= 1;
echo "<a href='index.php?mapchange=1&mapname=Crocania'>Crocania</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Fordale Woods'>Fordale Woods</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Mintus Mountains'>Mintus Mountains</a><br>";
echo "<br><br><br><br><a href='index.php'>NeverMind</a><br>";
}
if(isset($_GET['mapchange']))
{
$bypass=1;
$mapname = $_GET['mapname'];
$updateplayer="update players set location='$mapname' where name='$playerinfo3[name]'";
mysql_query($updateplayer) or die("Could not update player");
echo "You have traveled to " . $mapname . ".<br>";
echo "<a href='index.php'>To location</a><br>";
}
/////////////////////////////Guild Page/////////////////////////
if((isset($_GET['guild']) && $playerinfo3['guildid'] != 0) || (isset($_POST['guild']) && $playerinfo3['guildid'] != 0))
{
$bypass = 1;
if(isset($_POST['invite']))
{
$user = $_POST['user'];
$name = $_POST['name'];
$guild = $_POST['guild'];
$guildid2 = $_POST['guildid'];
$subject = "Guild Invite for the " . $guild . " guild";
$message = $_POST['message'];
$randid = rand(999,999999);
$messagedate = date('Y-m-d');
$message = $message . mysql_real_escape_string("<br><br><center><form method='POST' action='index.php'>
<input type='hidden' name='joinguild' value='1'>
<input type='hidden' name='guildid' value='$guildid2'>
<input type='submit' vaue='Join Guild' name='submit'></form>");
$SQL = "INSERT into messages(pid, sender, message, subject, randid, date) VALUES ('$name','$user','$message','$subject','$randid','$messagedate')"; mysql_query($SQL) or die("Could not add to Messages");
echo "<center>Guild Invite Sent<b><b><br><br>";
}
$guildid = $playerinfo3['guildid'];
$guildinfo="SELECT * from guilds where gid='$guildid'";
$guildinfo2=mysql_query($guildinfo) or die("Could not get Guild Stats!");
$guildinfo3=mysql_fetch_array($guildinfo2);
$playerguildinfo="SELECT * from guildmembers where name='$player' AND guildid='$guildid'";
$playerguildinfo2=mysql_query($playerguildinfo) or die("Could not get Guild Stats!!");
$playerguildinfo3=mysql_fetch_array($playerguildinfo2);
$access = $playerguildinfo3['access'];
$accessinfo="SELECT name from guildlevels where access='$access'";
$accessinfo2=mysql_query($accessinfo) or die("Could not get Guild Access Stats!");
$accessinfo3=mysql_fetch_array($accessinfo2);
echo "<b>" . $guildinfo3['name'] . "</b><br>";
echo $guildinfo3['welcome'] . "<br><br>";
echo "Welcome " . $accessinfo3['name'] . " " . $player;
echo "<table border='1'><tr><td><center><b>Invite Player to guild</b><br><form method='POST' action='index.php'>";
echo "Player Name: <input type='text' name='name' size='21'><br>";
echo "Message to player: <input type='text' name='message' size='80'><br>";
echo "<input type='hidden' name='guild' value='1'>";
echo "<input type='hidden' name='guildid' value='$guildid'>";
echo "<input type='hidden' name='invite' value='1'>";
echo "<input type='hidden' name='user' value='$player'>";
echo "<input type='hidden' name='guild' value='$guildinfo3[name]'>";
echo "<input type='submit' value='Invite Player' name='submit'></form></center></td></tr></table>";
echo "<table border='1'><tr><td><center><b>Manage Members</b><br><form method='POST' action='index.php'>";
echo "<input type='hidden' name='manage' value='1'>";
echo "<input type='hidden' name='guild' value='1'>";
echo "<input type='submit' value='See Members' name='submit'></form></center></td></tr>";
///////////////////////////////////////////////See guild members///////////////
if(isset($_POST['manage']))
{
echo "<small>";
print "<center>";
print "<table border='0' width='90%' cellspacing='10'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='85%'>";
$selectbackpack="SELECT * from guildmembers where guildid='$guildid'";
$selectbackpack2=mysql_query($selectbackpack) or die("Could not Select Guild Members");
print "<table border='1' bordercolor='black' bgcolor='#FFFFFF'>";
print "<tr><td>Name</td><td>Rank</td><td>Location</td>";
while($selectbackpack3=mysql_fetch_array($selectbackpack2))
{
print "<tr><td><center>$selectbackpack3[name]</td><td>$selectbackpack3[access]</td></tr>";
}
print "</table>";
print "</td></td></table>";
print "</center>";
echo "</small>";
}
/////////////////////////////////////////////////
echo "</table>";
echo "<br><br><form method='POST' action='index.php'>";
echo "<input type='submit' value='Go Back' name='submit'></form>";
}
/////////////////////////////Join Guild////////////////////////
if(isset($_POST['joinguild']))
{
$guildid = $_POST['guildid'];
$SQL = "INSERT into guildmembers(name, guildid, access) VALUES ('$player','$guildid','1')";
mysql_query($SQL) or die("Could not create guild!");
$updateplayer="update players set guildid='$guildid' where name='$player'";
mysql_query($updateplayer) or die("Could not add guild to player");
echo "<b>Guild Joined!</b><br><br>";
}
/////////////////////////////QUEST LOG/////////////////////////
if(isset($_GET['quests']))
{
$bypass = 1;
echo "<small>";
print "<center>";
print "<table border='0' width='90%' cellspacing='10'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='85%'>";
$selectbackpack="SELECT * from currentquests where pid='$playerinfo3[name]'";
$selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
print "<table border='1' bordercolor='black' bgcolor='#FFFFFF'>";
print "<tr><td> Quest Giver </td><td>Quest Description </td></td><td>Location</td>";
while($selectbackpack3=mysql_fetch_array($selectbackpack2))
{
print "<tr><td><center>$selectbackpack3[name]</td><td>$selectbackpack3[description]</td><td>$selectbackpack3[location]</td></tr>";
}
print "</table>";
print "</td></td></table>";
print "</center>";
echo "</small>";
echo "<center><br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Back'>";
echo "</form></center>";
}
//////////////////////////////////////////////////////////
if($bypass != 1)
{
echo "<b><big><u>" . $playerinfo3['location'] . "</u></big></b><br>";
echo "<a href='store.php'>Visit Store<br>";
echo "<a href='weaponshop.php'>Visit Weapon Shop</a><br>";
echo "<a href='armorshop.php'>Visti Armor Shop</a><br>";
echo "<a href='inn.php'>Visit Inn</a><br>";
echo "<a href='spelltrainer.php'>Visit Spell Trainer</a><br>";
echo "<a href='startguild.php'>Start Guild</a><br>";
echo "<a href='quests.php'>Visit Quest Hall</a><br>";
echo "<a href='battle.php'>Battle in Arena</a><br>";
echo "<a href='index.php?map=1'>Go to Map</a><br>";
}
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'></a>";
?>
</div>
Im dumb;)
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: video 33
is this the same problem that was resolved in 32?
-
- Posts: 165
- Joined: Tue Oct 13, 2009 4:22 pm
Re: video 33
It dose every thing that this video dose apart from when the user that you invited doset get the 'Join Guild' in the message...
Im dumb;)
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: video 33
show me what he does get.
-
- Posts: 165
- Joined: Tue Oct 13, 2009 4:22 pm
Re: video 33
O.K. Heres what he gets in his message:
![Image](http://i721.photobucket.com/albums/ww215/Grimlock257/Guildinviteerror.png)
(Dont know what its ony showinf half, nevermind, there nothing on to right hand side anyways...
And heres the code once more:
index.php:
kk, the problem is on the page before this one and if any other scripts are needed let me know:)
Reply ASAP
P.S Can you give me the thing for guildlevels eg:
name (int)5 AUTO thingy
1 (int)1 etc etc.....
Thanks
![Image](http://i721.photobucket.com/albums/ww215/Grimlock257/Guildinviteerror.png)
(Dont know what its ony showinf half, nevermind, there nothing on to right hand side anyways...
And heres the code once more:
index.php:
Code: Select all
<?php
include_once 'connect.php';
session_start();
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;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$bypass = 0;
include_once 'statpanel.php';
?>
<div id ="locations">
<?php
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
{
echo "You are dead!" ;
echo "<br><a href='useitem.php'>Use an Item";
exit;
}
if(isset($_GET['map']))
{
$bypass= 1;
echo "<a href='index.php?mapchange=1&mapname=Crocania'>Crocania</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Fordale Woods'>Fordale Woods</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Mintus Mountains'>Mintus Mountains</a><br>";
echo "<br><br><br><br><a href='index.php'>NeverMind</a><br>";
}
if(isset($_GET['mapchange']))
{
$bypass=1;
$mapname = $_GET['mapname'];
$updateplayer="update players set location='$mapname' where name='$playerinfo3[name]'";
mysql_query($updateplayer) or die("Could not update player");
echo "You have traveled to " . $mapname . ".<br>";
echo "<a href='index.php'>To location</a><br>";
}
/////////////////////////////Guild Page/////////////////////////
if((isset($_GET['guild']) && $playerinfo3['guildid'] != 0) || (isset($_POST['guild']) && $playerinfo3['guildid'] != 0))
{
$bypass = 1;
if(isset($_POST['invite']))
{
$user = $_POST['user'];
$name = $_POST['name'];
$guild = $_POST['guild'];
$guildid2 = $_POST['guildid'];
$subject = "Guild Invite for the " . $guild . " guild";
$message = $_POST['message'];
$randid = rand(999,999999);
$message = $message . mysql_real_escape_string("<br><br><center><form method='POST' action='index.php'>
<input type='hidden' name='joinguild' value='1'>
<input type='hidden' name='guildid' value='$guildid2'>
<input type='submit' value='Join Guild' name='submit'></form>");
$SQL = "INSERT into messages(pid, sender, message, subject, randid) VALUES ('$name','$user','$message','$subject','$randid')";
mysql_query($SQL) or die("Could not add to Messages");
echo "<center>Guild Invite Sent<b><b><br><br>";
}
$guildid = $playerinfo3['guildid'];
$guildinfo="SELECT * from guilds where gid='$guildid'";
$guildinfo2=mysql_query($guildinfo) or die("Could not get Guild Stats!");
$guildinfo3=mysql_fetch_array($guildinfo2);
$playerguildinfo="SELECT * from guildmembers where name='$player' AND guildid='$guildid'";
$playerguildinfo2=mysql_query($playerguildinfo) or die("Could not get Guild Stats!!");
$playerguildinfo3=mysql_fetch_array($playerguildinfo2);
$access = $playerguildinfo3['access'];
$accessinfo="SELECT name from guildlevels where access='$access'";
$accessinfo2=mysql_query($accessinfo) or die("Could not get Guild Access Stats!");
$accessinfo3=mysql_fetch_array($accessinfo2);
echo "<b>" . $guildinfo3['name'] . "</b><br>";
echo $guildinfo3['welcome'] . "<br><br>";
echo "Welcome " . $accessinfo3['name'] . " " . $player;
echo "<table border='1'><tr><td><center><b>Invite Player to guild</b><br><form method='POST' action='index.php'>";
echo "Player Name: <input type='text' name='name' size='21'><br>";
echo "Message to player: <input type='text' name='message' size='80'><br>";
echo "<input type='hidden' name='guild' value='1'>";
echo "<input type='hidden' name='guildid' value='$guildid'>";
echo "<input type='hidden' name='invite' value='1'>";
echo "<input type='hidden' name='user' value='$player'>";
echo "<input type='hidden' name='guild' value='$guildinfo3[name]'>";
echo "<input type='submit' value='Invite Player' name='submit'></form></center></td></tr></table>";
echo "<table border='1'><tr><td><center><b>Manage Members</b><br><form method='POST' action='index.php'>";
echo "<input type='hidden' name='manage' value='1'>";
echo "<input type='hidden' name='guild' value='1'>";
echo "<input type='submit' value='See Members' name='submit'></form></center></td></tr>";
///////////////////////////////////////////////See guild members///////////////
if(isset($_POST['manage']))
{
echo "<small>";
print "<center>";
print "<table border='0' width='90%' cellspacing='10'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='85%'>";
$selectbackpack="SELECT * from guildmembers where guildid='$guildid'";
$selectbackpack2=mysql_query($selectbackpack) or die("Could not Select Guild Members");
print "<table border='1' bordercolor='black' bgcolor='#FFFFFF'>";
print "<tr><td>Name</td><td>Rank</td><td>Location</td>";
while($selectbackpack3=mysql_fetch_array($selectbackpack2))
{
print "<tr><td><center>$selectbackpack3[name]</td><td>$selectbackpack3[access]</td></tr>";
}
print "</table>";
print "</td></td></table>";
print "</center>";
echo "</small>";
}
/////////////////////////////////////////////////
echo "</table>";
echo "<br><br><form method='POST' action='index.php'>";
echo "<input type='submit' value='Go Back' name='submit'></form>";
}
/////////////////////////////Join Guild////////////////////////
if(isset($_POST['joinguild']))
{
$guildid = $_POST['guildid'];
$SQL = "INSERT into guildmembers(name, guildid, access) VALUES ('$player','$guildid','1')";
mysql_query($SQL) or die("Could not create guild!");
$updateplayer="update players set guildid='$guildid' where name='$player'";
mysql_query($updateplayer) or die("Could not add guild to player");
echo "<b>Guild Joined!</b><br><br>";
}
/////////////////////////////QUEST LOG/////////////////////////
if(isset($_GET['quests']))
{
$bypass = 1;
echo "<small>";
print "<center>";
print "<table border='0' width='90%' cellspacing='10'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='85%'>";
$selectbackpack="SELECT * from currentquests where pid='$playerinfo3[name]'";
$selectbackpack2=mysql_query($selectbackpack) or die("could not select backpack");
print "<table border='1' bordercolor='black' bgcolor='#FFFFFF'>";
print "<tr><td> Quest Giver </td><td>Quest Description </td></td><td>Location</td>";
while($selectbackpack3=mysql_fetch_array($selectbackpack2))
{
print "<tr><td><center>$selectbackpack3[name]</td><td>$selectbackpack3[description]</td><td>$selectbackpack3[location]</td></tr>";
}
print "</table>";
print "</td></td></table>";
print "</center>";
echo "</small>";
echo "<center><br><br><form method='post' action='index.php'>";
echo "<input type='submit' value='Back'>";
echo "</form></center>";
}
//////////////////////////////////////////////////////////
if($bypass != 1)
{
echo "<b><big><u>" . $playerinfo3['location'] . "</u></big></b><br>";
echo "<a href='store.php'>Visit Store<br>";
echo "<a href='weaponshop.php'>Visit Weapon Shop</a><br>";
echo "<a href='armorshop.php'>Visti Armor Shop</a><br>";
echo "<a href='inn.php'>Visit Inn</a><br>";
echo "<a href='spelltrainer.php'>Visit Spell Trainer</a><br>";
echo "<a href='startguild.php'>Start Guild</a><br>";
echo "<a href='quests.php'>Visit Quest Hall</a><br>";
echo "<a href='battle.php'>Battle in Arena</a><br>";
echo "<a href='index.php?map=1'>Go to Map</a><br>";
}
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'></a>";
?>
</div>
Reply ASAP
P.S Can you give me the thing for guildlevels eg:
name (int)5 AUTO thingy
1 (int)1 etc etc.....
Thanks
Im dumb;)
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: video 33
so what does the database show for the message?
-
- Posts: 165
- Joined: Tue Oct 13, 2009 4:22 pm
Re: video 33
Ok, hes all of them, the player sees whats above, but the dataase says different:
pid:
Rockstareza
subject:
Guild Invite for the Test Guild guild
message:
Hey join my guild<br><br><center><form method='POST' action='index.php'>
<input type='hidden' name='joinguild' value='1'>
<input type='hidden' name='guildid' value='6'>
<input type='submit' value='Join Guild' name='submit'></form>
randid, date and sender etc are all correct, now that strange, it says it in the db message but not the game, any ideas
reply asap
pid:
Rockstareza
subject:
Guild Invite for the Test Guild guild
message:
Hey join my guild<br><br><center><form method='POST' action='index.php'>
<input type='hidden' name='joinguild' value='1'>
<input type='hidden' name='guildid' value='6'>
<input type='submit' value='Join Guild' name='submit'></form>
randid, date and sender etc are all correct, now that strange, it says it in the db message but not the game, any ideas
reply asap
Im dumb;)
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: video 33
now lets see your messages.php