Ir para conteúdo
Fórum Script Brasil
  • 0

[AJUDA] Problema com um script


Derek Xenofonte

Pergunta

ae galera... boa tarde... sou novo no forum, e vim aqui especialmente para pedir ajudar a vocês pois peguei uns scripts de um webgame em um forum chines, o jogo é em ingles, mas estava eu fazendo uma adaptação para transforma-lo em portugues, é um jogo muito simples... só que estou encontrando algumas dificuldades com alguns scripts que estão apresentando erro.... gostaria de saber se tinha como me dá uma mão... para tentar corrigir os erros... são basicamente uns 5 scripts no maximo que estão com problemas.... mas gostaria de começar com apenas um por enquanto... vou postar o script e dizer a linha de erro e qual o erro que ta aparecendo ok? desde já galera... agradeço.

<?php

if($_GET['opp'] == "Rainbow Tower"){
include 'shopstuff.php';
$keys = Check_Item(60, $user->id);
if($keys == 0){
echo Message("You need a Rainbow Key before you can enter this battle tower!<br><br>[<a href='towers.php'>Battle Towers</a>]");
include 'rightmenu.php';
die();
}
Take_Multi(60, $user->id, 1);
}
if($_GET['opp'] == "Cursed Tower"){
include 'shopstuff.php';
$keys = Check_Item(61, $user->id);
if($keys == 0){
echo Message("You need a Cursed Key before you can enter this battle tower!<br><br>[<a href='towers.php'>Battle Towers</a>]");
include 'rightmenu.php';
die();
}
Take_Multi(61, $user->id, 1);
}
if($_GET['opp'] == "Unown Tower"){
include 'shopstuff.php';
$keys = Check_Item(13, $user->id);
if($keys == 0){
echo Message("You need a Odd Key before you can enter this battle tower!<br><br>[<a href='towers.php'>Battle Towers</a>]");
include 'rightmenu.php';
die();
}
Take_Multi(13, $user->id, 1);
}
//START BLISSEY
if($_GET['opp'] == "Blissey Tower" || $_GET['opp'] == "Blissey_Tower"){
if($_COOKIE['blissey'] != "" && $_POST['blissey'] == ""){$_POST['blissey'] = $_COOKIE['blissey'];}
if($_POST['blissey'] == 1){$cost=75;$multiply=1;}
if($_POST['blissey'] == 2){$cost=150;$multiply=2;}
if($_POST['blissey'] == 3){$cost=300;$multiply=3;}
if($user->coins < $cost){echo Message("You don't have enough coins to enter the tower.<br><br>[<a href='towers.php'>Battle Towers</a>]");include 'rightmenu.php';die();}
if($cost < 1){include 'battle_error.php';}
$user->coins = $user->coins - $cost;
mysql_query("UPDATE `users` SET `coins` = '$user->coins' WHERE `id`='$user->id'");
}
//END BLISSEY
//END TOWERS
$_SESSION['slot'] = 1;
$_SESSION['hlot'] = 1;
$h = 1;
$slot = 1;
if($_SESSION['effect']){unset($_SESSION['effect']);}
if($_SESSION['myfect']){unset($_SESSION['myfect']);}
if($_SESSION['oeffect']){unset($_SESSION['oeffect']);}
if($_SESSION['omyfect']){unset($_SESSION['omyfect']);}
//if player
if($_GET['t'] != ""){
$tra = 1;
if($_GET['opp'] == "throne" || $_GET['opp'] == "Throne"){
$land1 = mysql_query("SELECT throne FROM `lands` WHERE `id`='".$user->land."'");
$land = mysql_fetch_object($land1);
$throne = 1;
$tra = 100;
$oppuser1 = mysql_query("SELECT username FROM `users` WHERE `id`='".$land->throne."'");
$oppuser = mysql_fetch_object($oppuser1);
$_GET['opp'] = $oppuser->username;
}
if($_GET['t'] == 3){
$opp11 = mysql_query("SELECT * FROM `poke_owned` WHERE `id` = '".$_GET['opp']."' LIMIT 0,1");
$tra = 3;
$oppuser->id = 1;
}else if($_GET['t'] == 2){
$oppuser1 = mysql_query("SELECT id,username FROM `users` WHERE `id`='".$_GET['opp']."'");
$oppuser = mysql_fetch_object($oppuser1);
}else{
$oppuser1 = mysql_query("SELECT id,username FROM `users` WHERE `username`='".$_GET['opp']."'");
$oppuser = mysql_fetch_object($oppuser1);
}
$_GET['opp'] = $oppuser->username;
if($oppuser->id < 1){
echo Message("You can't battle a user that doesn't exist.<br><br>[<a href='battlep.php'>Back</a>]");
include 'rightmenu.php';
die();
}
if($_GET['t'] != 3){
$opp11 = mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='".$_GET['opp']."' AND `slot` != '0' ORDER BY `slot` ASC LIMIT 0,6");
}
while($opp1=mysql_fetch_object($opp11)){
$o++;
if($o == 1){$_SESSION['opp'] = $opp1->trainer;}
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name`='".$opp1->name."'");
$oppstat=mysql_fetch_object($oppstat1);
$oppname[$o] = $oppstat->name;
$opplevel[$o] = floor(pow($opp1->totalexp,1/3));
$opphp[$o] = round((($oppstat->hp/50)+1.3)*$opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = $opp1->move1;
$move2[$o] = $opp1->move2;
$move3[$o] = "Double Kick";
$move4[$o] = "Shadow Claw";
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
}
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
}
//if a tower
if($_GET['tower'] == 1 && $_GET['t'] == ""){
$highestlevel = max($_SESSION['tlevel']);
$opp11=mysql_query("SELECT * FROM `towers` WHERE `trainer`='".$_GET['opp']."'");
$opp1=mysql_fetch_object($opp11);
$i = 0;
$current = $opp1->amount;
while($i < $current){
$i++;
$o++;
if($o == 1){$_SESSION['opp'] = $opp1->trainer;}
if ($i % 2) {
$typez = "type1";
}else{
$typez = "type2";
}
if ($i % 3) {
$typez2 = $opp1->name2;
}else{
$typez2 = $opp1->name;
}
if($i == $current){
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `id` = '$opp1->prize' Limit 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}elseif($opp1->name == "Cursed" || $opp1->name == "Rainbow"){
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name` LIKE '".$opp1->name."%' ORDER BY RAND() Limit 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}elseif($opp1->name == "Unown"){
$letter = strtoupper(chr($i + 96));
$unown = "Unown".$letter;
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name` = '".$unown."' Limit 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}else{
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `".$typez."` = '".$typez2."' ORDER BY RAND() Limit 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}
if($oppstat->name == ""){
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `type1` = '$opp1->name' ORDER BY RAND() Limit 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}
if($opp1->name == "One"){
if($opp1->name2 == "Snorlax"){
if($user->snorlax > 0){mysql_query("UPDATE `users` SET `snorlax` = '0' WHERE `id`='$user->id'");$user->snorlax = 0;}
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name` = '".$opp1->name2."' LIMIT 0,1");
$oppstat=mysql_fetch_object($oppstat1);
}
if($opp1->name2 == "Blissey" && $multiply > 0){
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name` = '".$opp1->name2."' LIMIT 0,1");
$oppstat=mysql_fetch_object($oppstat1);
$opp1->level = $multiply;
}
}
if(rand(1,2) == 1){$opp1->move1 = "Toxic";}
$oppname[$o] = $oppstat->name;
$opplevel[$o] = $opp1->level * $highestlevel;
$opphp[$o] = round((($oppstat->hp/50)+1.3)*$opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = $opp1->move1;
$move2[$o] = $opp1->move2;
$move3[$o] = $opp1->move3;
$move4[$o] = $opp1->move4;
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
}
$tra = 4;
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
}
//if a gym
if($_GET['gym'] != ""){
$opp11=mysql_query("SELECT * FROM `kakashi` WHERE `trainer`='".$_GET['opp']."' ORDER BY `slot` ASC");
while($opp1=mysql_fetch_object($opp11)){
$o++;
if($o == 1){$_SESSION['opp'] = $opp1->trainer;}
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `name`='".$opp1->name."'");
$oppstat=mysql_fetch_object($oppstat1);
if($opp1->gym != $user->land){include 'battle_error.php';}
$oppstat1=mysql_query("SELECT name,hp,type1,type2 FROM `pokemon` WHERE `name`='".$opp1->name."'");
$oppstat=mysql_fetch_object($oppstat1);
$oppname[$o] = $oppstat->name;
$opplevel[$o] = $opp1->level;
$opphp[$o] = round((($oppstat->hp/50)+1.3)*$opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = $opp1->move1;
$move2[$o] = $opp1->move2;
$move3[$o] = $opp1->move3;
$move4[$o] = $opp1->move4;
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
}
$tra = 2;
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
}
//if a normal npc
if($_GET['t'] == "" && $_GET['gym'] == "" & $_GET['tower'] == ""){
$highestlevel = max($_SESSION['tlevel']);
$opp11=mysql_query("SELECT * FROM `opponents` WHERE `trainer`='".$_GET['opp']."' ORDER BY `slot` ASC");
while($opp1=mysql_fetch_object($opp11)){
$o++;
if($o == 1){$_SESSION['opp'] = $opp1->trainer;}
$oppstat1=mysql_query("SELECT name,hp,type1,type2 FROM `pokemon` WHERE `name`='".$opp1->name."'");
$oppstat=mysql_fetch_object($oppstat1);
$oppname[$o] = $oppstat->name;
$opplevel[$o] = $opp1->level * $highestlevel;
$opphp[$o] = round($opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = $opp1->move1;
$move2[$o] = $opp1->move2;
$move3[$o] = $opp1->move3;
$move4[$o] = $opp1->move4;
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
}
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
}
//if a missingno
if($_GET['opp'] == "Missingno." && $user->pok == 1337){
mysql_query("UPDATE `users` SET `pok` = '0' WHERE `id`='$user->id'");
$highestlevel = max($_SESSION['tlevel']);
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `id`='0'");
$oppstat=mysql_fetch_object($oppstat1);
$oppname[$o] = "Wild";
$opplevel[$o] = 3 * $highestlevel;
$opphp[$o] = round((($oppstat->hp/50)+1.3)*$opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = "Double Kick";
$move2[$o] = "Toxic";
$move3[$o] = "Shadow Claw";
$move4[$o] = "Recover";
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
$tra = 9;
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
$desc = "Wild Missingno. appeared! What will you do!?";
$_GET['opp'] == Wild;
}
//end if missingno
//if a lab
if($_GET['opp'] == "lab" && $user->pokrand == 10001){
include 'labwild.php';
mysql_query("UPDATE `users` SET `pokrand` = '0' WHERE `id`='$user->id'");
$highestlevel = max($_SESSION['tlevel']);
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `id`='$poke'");
$oppstat=mysql_fetch_object($oppstat1);
$o = 1;
$oppname[$o] = "Wild";
$opplevel[$o] = 3 * $highestlevel;
$opphp[$o] = round((($oppstat->hp/50)+1.3)*$opplevel[$o] + 10);
$opptotalhp[$o] = $opphp[$o];
$move1[$o] = "Double Kick";
$move2[$o] = "Toxic";
$move3[$o] = "Hyperbeam";
$move4[$o] = "Recover";
$type1[$o] = $oppstat->type1;
$type2[$o] = $oppstat->type2;
$tra = 9;
$_SESSION['oppname'] = $oppname;
$_SESSION['opplevel'] = $opplevel;
$_SESSION['opphp'] = $opphp;
$_SESSION['opptotalhp'] = $opptotalhp;
$_SESSION['move1'] = $move1;
$_SESSION['move2'] = $move2;
$_SESSION['move3'] = $move3;
$_SESSION['move4'] = $move4;
$_SESSION['type1'] = $type1;
$_SESSION['type2'] = $type2;
$desc = "".$user->username.": Looks like I'll need a ".$ball." Pokeball to catch this pokemon.";
}
//end if a lab
//start if HALLOWEEN EVENT GHOST
if($_GET['opp'] == "ghost" && $user->pokrand == 10002){
mysql_query("UPDATE `users` SET `pok` = '0' WHERE `id`='$user->id'");
$highestlevel = max($_SESSION['tlevel']);
$oppstat1=mysql_query("SELECT name,pic,hp,type1,type2 FROM `pokemon` WHERE `id`='0'");
$oppstat=mysql_fetch_object($oppstat1);
$opplevel = 5;
$opphp = round((($oppstat->hp/50)+1.3)*$opplevel + 10);
mysql_query("INSERT INTO battle (hp,totalhp,user,trainer,poke,level,pic,move1,move2,move3,move4,type1,type2,tra)"."VALUES('$opphp','$opphp', '$user->id','Wild','Ghost','".$opplevel."','".$oppstat->pic."','Double Kick','Toxic','Shadow Claw','Recover','".$oppstat->type1."','".$oppstat->type2."','9')");
$desc = "A wild GHOST has appeared! What will you do!?";
$_GET['opp'] == Wild;
}
//end if HALLOWEEN EVENT GHOST
//heal pokemon
$poke11 = mysql_query("SELECT hp FROM `pokemon` WHERE `name`='$pokemon1->name' LIMIT 0,1");
$poke1 = mysql_fetch_object($poke11);
if($_SESSION['tlevel'][2] > 0){
$poke21=mysql_query("SELECT hp FROM `pokemon` WHERE `name`='".$_SESSION['team'][2]."'");
$poke2=mysql_fetch_object($poke21);
$_SESSION['thptotal'][2] = round((($poke2->hp/50)+1.3)*$_SESSION['tlevel'][2]+10);
}
if($_SESSION['tlevel'][3] > 0){
$poke31=mysql_query("SELECT hp FROM `pokemon` WHERE `name`='".$_SESSION['team'][3]."'");
$poke3=mysql_fetch_object($poke31);
$_SESSION['thptotal'][3] = round((($poke3->hp/50)+1.3)*$_SESSION['tlevel'][3]+10);
}
if($_SESSION['tlevel'][4] > 0){
$poke41=mysql_query("SELECT hp FROM `pokemon` WHERE `name`='".$_SESSION['team'][4]."'");
$poke4=mysql_fetch_object($poke41);
$_SESSION['thptotal'][4] = round((($poke4->hp/50)+1.3)*$_SESSION['tlevel'][4]+10);
}
if($_SESSION['tlevel'][5] > 0){
$poke51=mysql_query("SELECT hp FROM `pokemon` WHERE `name`='".$_SESSION['team'][5]."'");
$poke5=mysql_fetch_object($poke51);
$_SESSION['thptotal'][5] = round((($poke5->hp/50)+1.3)*$_SESSION['tlevel'][5]+10);
}
if($_SESSION['tlevel'][6] > 0){
$poke61=mysql_query("SELECT hp FROM `pokemon` WHERE `name`='".$_SESSION['team'][6]."'");
$poke6=mysql_fetch_object($poke61);
$_SESSION['thptotal'][6] = round((($poke6->hp/50)+1.3)*$_SESSION['tlevel'][6]+10);
}
$_SESSION['thptotal'][1] = round((($poke1->hp/50)+1.3)*$_SESSION['tlevel'][1]+10);
if($_SESSION['thp'][1] != $_SESSION['thptotal'][1]){$_SESSION['thp'][1] = $_SESSION['thptotal'][1];}
if($_SESSION['thp'][2] != $_SESSION['thptotal'][2]){$_SESSION['thp'][2] = $_SESSION['thptotal'][2];}
if($_SESSION['thp'][3] != $_SESSION['thptotal'][3]){$_SESSION['thp'][3] = $_SESSION['thptotal'][3];}
if($_SESSION['thp'][4] != $_SESSION['thptotal'][4]){$_SESSION['thp'][4] = $_SESSION['thptotal'][4];}
if($_SESSION['thp'][5] != $_SESSION['thptotal'][5]){$_SESSION['thp'][5] = $_SESSION['thptotal'][5];}
if($_SESSION['thp'][6] != $_SESSION['thptotal'][6]){$_SESSION['thp'][6] = $_SESSION['thptotal'][6];}
if($_SESSION['tra'] != $tra){$_SESSION['tra'] = $tra;}
?>

no caso o erro se repete várias vezes no script pois ele é feito com estruturas repetidas.....

no caso ai esta aparecendo os seguintes erros ok?

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line 281

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line 283

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line 281

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line 283

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line 281

Warning: Cannot use a scalar value as an array in C:\AppServ\www\battlestart1337.php on line
283


desde já agradeço galera!

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,5k
×
×
  • Criar Novo...