Page 2 of 2

Re: Attacking mob on map

Posted: Thu Dec 24, 2009 12:44 am
by Torniquet
just leave it like this....

Code: Select all

$mapcrsql="SELECT * FROM map WHERE mapr='$_SESSION[mapr]' AND mapc='$_SESSION[mapc]' LIMIT 1";
ive never had a problem doing it that way.

Re: Attacking mob on map

Posted: Fri Dec 25, 2009 6:07 am
by GrInd3r
Right I changed it... so im trying to think here.. that wasnt updating the rows.. could I just populate the creatures database randomly and have there x and y stored in there and just read it from the map... im very confusedddddddddddddddddddddddddd

Re: Attacking mob on map

Posted: Fri Dec 25, 2009 9:26 am
by Torniquet
im not sure i understand what you mean :s

do you mean that in your creature DB you have an X n Y field for the positionings of all your mobs, and when a player is on that particular coord the mob is shown to be on the map??

something like...

Code: Select all

$userLocation = mysql_fetch_assoc(mysql_query("SELECT player_x, player_y FROM user_database WHERE user_id='$uid'"));

$monsters = mysql_query("SELECT monster_id, monster_name FROM monster_database WHERE monster_x='$userLocation[player_x]' AND monster_y='$userLocation[player_y]'");

while ($row = mysql_fetch_assoc($monsters){
echo $row['monster_name'];
}
if thats what you mean then yes, that should work.

if on the other hand thats not what you mean, then sorry i dont understand what your trying to say :p lol

peace n love on xmas x