Jump to content

Need Help


ricerocket

Recommended Posts

Hi, I need help with this script of mine. The players arent supposed to be able to change their race unless they have at least a skill level of 7. But it's letting them change they;re race anyways.

 

Heres the script:

 

if ($action == "race" && $selected != "y"){



if ($playerinfo[race] != "Ghost" && $playerinfo[skill] >7) {

echo "You can't repick your race untill race skill 7.";

}



        echo "Please choose your race. Study their powers carefully, as once you have chosen, there is no going back.<br><br></a>";







?>



<form class=mainAJAX method="POST" action="hut/hut.php?action=race">



<select name="select">

<option value='0'>Select Race</option>

<option value='1'>Human</option>

<option value='2'>Orc</option>

<option value='3'>High Elf</option>

<option value='4'>Dark Elf</option>

<option value='5'>Dwarf</option>

<option value='10'>Undead</option>

<option value='11'>Blood elves</option>

</select>

<input type="hidden" name="selected" value="y">

<input type="submit" value="Pick">

</form>

<br><br><center>[<a class=mainAJAX href=hut.php>Return to hut</a>]</center>

<?





       }



if ($action == "race" && $selected == "y") {



if ($playerinfo[race] != "Ghost" && $playerinfo[skill] < 7) {

echo "You can't repick your race untill race skill 7.";

}



if ($select == 0) {

echo "You must select a race.";

}



if ($select == 1) {

$race = "Human";

}



if ($select == 2) {

$race = "Orc";

}



if ($select == 3) {

$race = "High Elf";

}



if ($select == 4) {

$race = "Dark Elf";

}



if ($select == 5) {

$race = "Dwarf";

}

if ($select == 10) {

$race = "Undead";

}

if ($select == 11) {

$race = "Blood Elf";
}

if (!$race) {

echo "Error.";

}



echo "You have selected the <b>$race</b> race. Are you sure? <a class=mainAJAX href=hut/hut.php?action=race&select=$select&confirm=yes>Yes</a>.<br><br><i>You may not repick your race until you reach Skill Level 7.";



}



if ($action == "race" && $select && $confirm == "yes") {

if ($playerinfo[race] != "Ghost" && $playerinfo[skill] < 7) {

echo "You can't repick your race untill race skill 7.";

}



if ($select == 0) {

echo "You must select a race.";

}



if ($select == 1) {

$race = "Human";

}



if ($select == 2) {

$race = "Orc";

}



if ($select == 3) {

$race = "High Elf";

}



if ($select == 4) {

$race = "Dark Elf";

}



if ($select == 5) {

$race = "Dwarf";

}



if ($select == 10) {

$race = "Undead";

}

if ($select == 11) {

$race = "Blood Elf";
}

if (!$race) {

echo "Error.";

}



$done = mysql_query("update userdb set race='$race', skill=1 where id='$playerinfo[id]'");



echo "You watch as a bright glowing surrounds your body. You lose conciousness. When you awake, everything about you seems...different. Your mind. Your body. Even your surroundings seem different...as if they are viewed from a new viewpoint, a new way of seeing things. A sudden realisation occurs that you have now truly chosen your path. And with certainty, you decide that you will follow it through to the end.<br><br><i>You are now a member of the <b>$race</b> race.</i>";

}

Link to comment
https://forums.phpfreaks.com/topic/97464-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.