help please

Location of the Videos
Post Reply
thorian
Posts: 30
Joined: Mon Aug 01, 2011 10:55 pm

help please

Post by thorian »

well im sorta confused of how to accomplish this script.. I want to make a drop down menu to select creatures from to battle. and something else im confused about is making an experience echo from current to next...
srry on android.
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: help please

Post by Nexus »

make your creature query
then you are going to do a while loop

Code: Select all

while($creatureinfo3 = mysql_fetch_array($creatureinfo2)) {
echo "<select>
         <option>$creatureinfo3['name']</option>
        </select>";
}
thorian
Posts: 30
Joined: Mon Aug 01, 2011 10:55 pm

Re: help please

Post by thorian »

thx man. so simple lol. so.. what about exp though. I have no idea
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: help please

Post by Xaleph »

Code has a bug, this way you create a select for every monster right?

echo 'select name="monster">';

while(){
echo $someMonsterVal;
}

echo '</select>';
thorian
Posts: 30
Joined: Mon Aug 01, 2011 10:55 pm

Re: help please

Post by thorian »

im confused at ur code xal :/ ill try tinkering when I get home from work if u haven't responded before then
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: help please

Post by Xaleph »

Code: Select all

By Nexus:

Code: Select all
    while($creatureinfo3 = mysql_fetch_array($creatureinfo2)) {
    echo "<select>
             <option>$creatureinfo3['name']</option>
            </select>";
    }

The only problem is that you are creating a select for each $creature. That`s not good right? You want all creatures in 1 select. So i`m suggesting to echo the select outside the while loop.

Code: Select all

    echo '<select>';
    while($creatureinfo3 = mysql_fetch_array($creatureinfo2)) {
    echo "<option>$creatureinfo3['name']</option>";
    }
    echo '</select>';
thorian
Posts: 30
Joined: Mon Aug 01, 2011 10:55 pm

Re: help please

Post by thorian »

oooh. I understand. thxxx :)
. xal do u know how to generate an echo til next lvl up / exp til.
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: help please

Post by Nexus »

well put this in the statpanel if it doesn't already show exper(haven't messed with the tutorial in a long time :P)

Code: Select all

echo "$playerinfo3['exper'] / $playerinfo3['experneeded']"
thorian
Posts: 30
Joined: Mon Aug 01, 2011 10:55 pm

Re: help please

Post by thorian »

luv
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: help please

Post by Nexus »

:) glad I could help
Post Reply

Return to “Older Browser MMO Videos”