alcapone Posted June 4, 2008 Share Posted June 4, 2008 hello every one, im working on a mafia game and trying to get this attack to work and not haveing any luck at all now i made this one here and all works fine <? $thug = $user[thugs]+$user[hitmen]+$user[bodyguards];$glock = $user[glock];$shotgun = $user[shotgun];$uzi = $user[uzi];$ak47 = $user[ak47];$ninemm = $user[ninemm]; $thugE = $enemy[thugs]+$enemy[hitmen]+$enemy[bodyguards];$glockE = $enemy[glock];$shotgunE = $enemy[shotgun];$uziE = $enemy[uzi];$ak47E = $enemy[ak47];$ninemmE = $enemy[ninemm]; if($ninemm < $thug) {$thug1=$thug-$ninemm; } elseif($thug <= $ninemm) {$ninemm=$thug;$thug1=0; } if($ak47 < $thug1) {$thug2=$thug1-$ak47; } elseif($thug1 <= $ak47) {$ak47=$thug1;$thug2=0; } if($uzi < $thug2) {$thug3=$thug2-$uzi;} elseif($thug2 <= $uzi) {$uzi=$thug2;$thug3=0;} if($shotgun < $thug3) {$thug4=$thug3-$shotgun;} elseif($thug3 <= $shotgun) {$shotgun=$thug3;$thug4=0;} if($glock < $thug4) {$thug5=$thug4-$glock;} elseif($thug4 <= $glock) {$glock=$thug4;$thug5=0;} if($ninemmE < $thugE) {$thugE1=$thugE-$ninemmE; } elseif($thugE <= $ninemmE) {$ninemmE=$thugE;$thugE1=0; } if($ak47E < $thugE1) {$thugE2=$thugE1-$ak47E; } elseif($thugE1 <= $ak47E) {$ak47E=$thugE1;$thugE2=0; } if($uziE < $thugE2) {$thugE3=$thugE2-$uziE;} elseif($thugE2 <= $uziE) {$uziE=$thugE2;$thugE3=0;} if($shotgunE < $thugE3) {$thugE4=$thugE3-$shotgunEs;} elseif($thugE3 <= $shotgunE){$shotgunE=$thugE3;$thugE4=0;} if($glockE < $thug4) {$thugE5=$thugE4-$glockE;} elseif($thugE4 <= $glockE) {$glockE=$thugE4;$thugE5=0;} //$bullets=$ak47*15+$uzi*10+$shotgun*5+$glock*1.5; //$bullets=round($bullets); $kill = round(fixinput(($glock*.05)+($shotgun*.10)+($uzi*.15)+($ak47*.25)+($ninemm*.35))); if($kill >= $enemy[thugs]){$kill=$enemy[thugs];} $kill2 = round(fixinput(($glock*.10)+($shotgun*.25)+($uzi*.35)+($ak47*.45)+($ninemm*.70))); if($kill2 >= $enemy[hitmen]){$kill2=$enemy[hitmen];} $kill3 = round(fixinput(($glock*.03)+($shotgun*.12)+($uzi*.20)+($ak47*.35)+($ninemm*.40))); if($kill3 >= $enemy[bodyguards]){$kill3=$enemy[bodyguards];} $killE = round(fixinput(($glockE*.05)+($shotgunE*.10)+($uziE*.15)+($ak47E*.25)+($ninemmE*.35))); if($killE >= $user[thugs]){$killE=$user[thugs];} $killE2 = round(fixinput(($glockE*.10)+($shotgunE*.25)+($uziE*.35)+($ak47E*.45)+($ninemmE*.70))); if($killE2 >= $user[hitmen]){$killE2=$user[hitmen];} $killE3 = round(fixinput(($glockE*.03)+($shotgunE*.12)+($uziE*.20)+($ak47E*.35)+($ninemmE*.40))); if($killE3 >= $user[bodyguards]){$killE3=$user[bodyguards];} $steal=losecash($enemy[id]); ?> <br> <font color="#8F92E8"> <?=($user[thugs]+$user[hitmen]+$user[bodyguards])?> </font> of your boys (<font color="#8F92E8"><?=commas($user[thugs])?></font> thugs <font color="#8F92E8"><?=commas($user[hitmen])?></font> hitmen <font color="#8F92E8"><?=commas($user[bodyguards])?></font> bodyguards) invaded <b><?=$pmp?>'s</b> headquarters. <br> armed with <?if($ninemm > 0){?><font color="#8F92E8"><?=commas($ninemm)?></font> M60's <?if(($ak47==0) && ($uzi==0) && ($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($ak47 > 0){?><font color="#8F92E8"><?=commas($ak47)?></font> ak47's <?if(($uzi==0) && ($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($uzi > 0){?><font color="#8F92E8"><?=commas($uzi)?></font> uzi's <?if(($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($shotgun > 0){?><font color="#8F92E8"><?=commas($shotgun)?></font> shotgun's <?if($glocks==0){echo".";}else{echo", ";} } if($glock > 0){?><font color="#8F92E8"><?=commas($glock)?></font> 9mm's. <?}?> <br> <b><?=$pmp?>'s</b> <font color="#8F92E8"><?=($enemy[thugs]+$enemy[hitmen]+$enemy[bodyguards])?></font> boys ( <font color="#8F92E8"><?=commas($enemy[thugs])?></font> thugs <font color="#8F92E8"><?=commas($enemy[hitmen])?></font> hitmen <font color="#8F92E8"><?=commas($enemy[bodyguards])?> </font>bodyguards ) welcomed you with <?if($ninemmE > 0){?><font color="#8F92E8"><?=commas($ninemmE)?></font> M60's <?if(($ak47E==0) && ($uziE==0) && ($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($ak47E > 0){?><font color="#8F92E8"><?=commas($ak47E)?></font> ak47's <?if(($uziE==0) && ($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($uziE > 0){?><font color="#8F92E8"><?=commas($uziE)?></font> uzi's <?if(($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($shotgunE > 0){?><font color="#8F92E8"><?=commas($shotgunE)?></font> shotgun's <?if($glockE==0){echo".";}else{echo", ";} } if($glockE > 0){?><font color="#8F92E8"><?=commas($glockE)?></font> 9mm's. <?}?> <br> <br> you managed to kill ( <font color="#8F92E8"><?=commas($kill)?></font> thugs <font color="#8F92E8"><?=commas($kill2)?> </font> hitmen <font color="#8F92E8"><?=commas($kill3)?></font> bodyguards) of <font color="#8F92E8"><?=$pmp?> 's</font> boys in the attack.<br> <?if ($killE >= $kill){?> <font color="#8F92E8"> <?}?> </font>they killed ( <font color="#8F92E8"> <?=commas($killE)?> </font> thugs <font color="#8F92E8"> <?=commas($killE2)?> </font> hitmen <font color="#8F92E8"> <?=commas($killE3)?> </font> bodyguards ) of your boys in the attack. <br> <br> <?if ($killE > $kill){?>Your boys start to run as they notice <b><?=$pmp?>'s</b> men standing their ground.<? $cash = fixinput($cash_total);$cashE = fixinput($enemy[cash]); }else{?>The fight was over, as <b><?=$pmp?>'s</b> boys start to run. <br> You stole <font color="#8F92E8">$<?=commas($steal)?></font> from <b><?=$pmp?>'s</b> headquarters.. <? $cash = fixinput($cash_total+$steal);$cashE = fixinput($enemy[cash]-$steal); $stealC=commas($steal); $stealmsg = "<a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]</a> stole $<font color=#8F92E8>$stealC</font> from your club."; } $thugE=fixinput($enemy[thugs]-$kill); $hitmenE=fixinput($enemy[hitmen]-$kill2); $bodyguardsE=fixinput($enemy[bodyguards]-$kill3); $thug=fixinput($user[thugs]-$killE); $hitmen=fixinput($user[hitmen]-$killE2); $bodyguards=fixinput($user[bodyguards]-$killE3); $thugskilled=fixinput($user[thugskilled]+$kill); $hitmenkilled=fixinput($user[hitmenkilled]+$kill2); $bodyguardskilled=fixinput($user[bodyguardskilled]+$kill3); $thugskilledE=fixinput($enemy[thugskilled]+$killE); $hitmenkilledE=fixinput($enemy[hitmenkilled]+$killE2); $bodyguardskilledE=fixinput($enemy[bodyguardskilled]+$killE3); $killC=commas($kill); $killC3=commas($kill3); $killC2=commas($kill2); $killEC=commas($killE); $killEC3=commas($killE3); $killEC2=commas($killE2); mysql_query("INSERT INTO $tab[mail] (rid,src,dest,msg,time,inbox) VALUES ('$rid','$id','$enemy[id]','$addmsg <a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]</a> invaded your club. <font color=#8F92E8>$killC</font> of your boys were killed. <font color=#8F92E8>$killEC</font> of <a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]'s</a> bouncers were also killed in the attack. $stealmsg','$time',1);"); mysql_query("UPDATE $tab[pimp] SET thugs='$thug', thugskilled='$thugskilled', hitmen='$hitmen', hitmenkilled='$hitmenkilled',bodyguards='$bodyguards', bodyguardskilled='$bodyguardskilled',cash='$cash' WHERE id='$id' AND rid='$rid'"); mysql_query("UPDATE $tab[pimp] SET thugs='$thugE', thugskilled='$thugskilledE', hitmen='$hitmenE', hitmenkilled='$hitmenkilledE',bodyguards='$bodyguardsE', bodyguardskilled='$bodyguardskilledE',cash='$cashE' WHERE id='$enemy[id]' AND rid='$rid'"); ?> now i edit this page to work to attack the Operatives in the game and not working right at all wont add anything to the database for enemy or user but it does kill a few of them and subtract them right just dont add them to data base here is that file <? $thug = $user[thugs]+$user[hitmen]+$user[bodyguards];$glock = $user[glock];$shotgun = $user[shotgun];$uzi = $user[uzi];$ak47 = $user[ak47];$ninemm = $user[ninemm]; $thugE = $enemy[hoes]+$enemy[bootleggers]+$enemy[dealers]+$enemy[punks]+$enemy[hustlers];$glockE = $enemy[glock];$shotgunE = $enemy[shotgun];$uziE = $enemy[uzi];$ak47E = $enemy[ak47];$ninemmE = $enemy[ninemm]; if($ninemm < $thug) {$thug1=$thug-$ninemm; } elseif($thug <= $ninemm) {$ninemm=$thug;$thug1=0; } if($ak47 < $thug1) {$thug2=$thug1-$ak47; } elseif($thug1 <= $ak47) {$ak47=$thug1;$thug2=0; } if($uzi < $thug2) {$thug3=$thug2-$uzi;} elseif($thug2 <= $uzi) {$uzi=$thug2;$thug3=0;} if($shotgun < $thug3) {$thug4=$thug3-$shotgun;} elseif($thug3 <= $shotgun) {$shotgun=$thug3;$thug4=0;} if($glock < $thug4) {$thug5=$thug4-$glock;} elseif($thug4 <= $glock) {$glock=$thug4;$thug5=0;} if($ninemmE < $thugE) {$thugE1=$thugE-$ninemmE; } elseif($thugE <= $ninemmE) {$ninemmE=$thugE;$thugE1=0; } if($ak47E < $thugE1) {$thugE2=$thugE1-$ak47E; } elseif($thugE1 <= $ak47E) {$ak47E=$thugE1;$thugE2=0; } if($uziE < $thugE2) {$thugE3=$thugE2-$uziE;} elseif($thugE2 <= $uziE) {$uziE=$thugE2;$thugE3=0;} if($shotgunE < $thugE3) {$thugE4=$thugE3-$shotgunEs;} elseif($thugE3 <= $shotgunE) {$shotgunE=$thugE3;$thugE4=0;} if($glockE < $thug4) {$thugE5=$thugE4-$glockE;} elseif($thugE4 <= $glockE) {$glockE=$thugE4;$thugE5=0;} //$bullets=$ak47*15+$uzi*10+$shotgun*5+$glock*1.5; //$bullets=round($bullets); ////////////start kills///////// $kill = round(fixinput(($glock*.04)+($shotgun*.06)+($uzi*.09)+($ak47*.11)+($ninemm*.13))); if($kill >= $enemy[hoes]){$kill=$enemy[hoes];} $kill2 = round(fixinput(($glock*.01)+($shotgun*.02)+($uzi*.05)+($ak47*.07)+($ninemm*.08))); if($kill2 >= $enemy[bootleggers]){$kill2=$enemy[bootleggers];} $kill3 = round(fixinput(($glock*.05)+($shotgun*.06)+($uzi*.13)+($ak47*.16)+($ninemm*.20))); if($kill3 >= $enemy[dealers]){$kill3=$enemy[dealers];} $kill4 = round(fixinput(($glock*.02)+($shotgun*.03)+($uzi*.08)+($ak47*.09)+($ninemm*.12))); if($kill4 >= $enemy[punks]){$kill3=$enemy[punks];} $kill5 = round(fixinput(($glock*.01)+($shotgun*.02)+($uzi*.05)+($ak47*.07)+($ninemm*.10))); if($kill5 >= $enemy[hustlers]){$kill3=$enemy[hustlers];} ////////////end kills//////// ///////start enemy kills///////// $killE = round(fixinput(($glockE*.05)+($shotgunE*.10)+($uziE*.15)+($ak47E*.25)+($ninemmE*.35))); if($killE >= $user[thugs]){$killE=$user[thugs];} $killE2 = round(fixinput(($glockE*.10)+($shotgunE*.25)+($uziE*.35)+($ak47E*.45)+($ninemmE*.70))); if($killE2 >= $user[hitmen]){$killE2=$user[hitmen];} $killE3 = round(fixinput(($glockE*.03)+($shotgunE*.12)+($uziE*.20)+($ak47E*.35)+($ninemmE*.40))); if($killE3 >= $user[bodyguards]){$killE3=$user[bodyguards];} ////////end enemy kills//////// $steal=losecash($enemy[id]); ?> <br> <font color="#8F92E8"> <?=($user[thugs]+$user[hitmen]+$user[bodyguards])?> </font> of your boys (<font color="#8F92E8"><?=commas($user[thugs])?></font> thugs <font color="#8F92E8"><?=commas($user[hitmen])?></font> hitmen <font color="#8F92E8"><?=commas($user[bodyguards])?></font> bodyguards) invaded <b><?=$pmp?>'s</b> headquarters. <br> armed with <?if($ninemm > 0){?><font color="#8F92E8"><?=commas($ninemm)?></font> M60's <?if(($ak47==0) && ($uzi==0) && ($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($ak47 > 0){?><font color="#8F92E8"><?=commas($ak47)?></font> ak47's <?if(($uzi==0) && ($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($uzi > 0){?><font color="#8F92E8"><?=commas($uzi)?></font> uzi's <?if(($shotgun==0) && ($glock==0)){echo".";}else{echo", ";} } if($shotgun > 0){?><font color="#8F92E8"><?=commas($shotgun)?></font> shotgun's <?if($glocks==0){echo".";}else{echo", ";} } if($glock > 0){?><font color="#8F92E8"><?=commas($glock)?></font> 9mm's. <?}?> <br> <b><?=$pmp?>'s</b> <font color="#8F92E8"><?=($enemy[hoes]+$enemy[bootleggers]+$enemy[dealers]+$enemy[punks]+$enemy[hustlers])?></font> boys ( <font color="#8F92E8"><?=commas($enemy[hoes])?></font> whores <font color="#8F92E8"><?=commas($enemy[bootleggers])?></font> bootleggers <font color="#8F92E8"><?=commas($enemy[dealers])?> </font>dealers <font color="#8F92E8"><?=commas($enemy[punks])?> </font>punks <font color="#8F92E8"><?=commas($enemy[hustlers])?> </font>hustlers) welcomed you with <br> <?if($ninemmE > 0){?><font color="#8F92E8"><?=commas($ninemmE)?></font> M60's <?if(($ak47E==0) && ($uziE==0) && ($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($ak47E > 0){?><font color="#8F92E8"><?=commas($ak47E)?></font> ak47's <?if(($uziE==0) && ($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($uziE > 0){?><font color="#8F92E8"><?=commas($uziE)?></font> uzi's <?if(($shotgunE==0) && ($glockE==0)){echo".";}else{echo", ";} } if($shotgunE > 0){?><font color="#8F92E8"><?=commas($shotgunE)?></font> shotgun's <?if($glockE==0){echo".";}else{echo", ";} } if($glockE > 0){?><font color="#8F92E8"><?=commas($glockE)?></font> 9mm's. <?}?> <br> <br> you managed to kill ( <font color="#8F92E8"><?=commas($kill)?></font> whores <font color="#8F92E8"><?=commas($kill2)?> </font> bootleggers <font color="#8F92E8"><?=commas($kill3)?></font> dealers <font color="#8F92E8"><?=commas($kill4)?></font> punks <font color="#8F92E8"><?=commas($kill5)?></font> hustlers) of <font color="#8F92E8"><?=$pmp?> 's</font> boys in the attack.<br> <?if ($killE+$killE2+$killE3 >= $kill+$kill2+$kill3+$kill4+$kill5){?> <font color="#8F92E8"> <?}?> </font>they killed ( <font color="#8F92E8"> <?=commas($killE)?> </font> thugs <font color="#8F92E8"> <?=commas($killE2)?> </font> hitmen <font color="#8F92E8"> <?=commas($killE3)?> </font> bodyguards ) of your boys in the attack. <br> <br> <?if ($killE+$killE2+ $killE3 > $kill+$kill2+$kill3+$kill4+$kill5){?>Your boys start to run as they notice <b><?=$pmp?>'s</b> men standing their ground.<? $cash = fixinput($cash_total);$cashE = fixinput($enemy[cash]); }else{?> The fight was over, as <b><?=$pmp?>'s</b> boys start to run. <br> You stole <font color="#8F92E8">$<?=commas($steal)?></font> from <b><?=$pmp?>'s</b> headquarters.. <? $cash = fixinput($cash_total+$steal);$cashE = fixinput($enemy[cash]-$steal); $stealC=commas($steal); $stealmsg = "<a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]</a> stole $<font color=#8F92E8>$stealC</font> from your club."; } $hoesE=fixinput($enemy[hoes]-$kill); $bootleggersE=fixinput($enemy[bootleggers]-$kill2); $dealersE=fixinput($enemy[dealers]-$kill3); $punksguardsE=fixinput($enemy[punks]-$kill4); $hustlersE=fixinput($enemy[hustlers]-$kill5); $thug=fixinput($user[thugs]-$killE); $hitmen=fixinput($user[hitmen]-$killE2); $bodyguards=fixinput($user[bodyguards]-$killE3); $hoeskilled=fixinput($user[hoeskilled]+$kill); $bootleggerskilled=fixinput($user[bootleggerskilled]+$kill2); $dealerskilled=fixinput($user[dealerskilled]+$kill3); $punkskilled=fixinput($user[punkskilled]+$kill4); $hustlerskilled=fixinput($user[hustlerskilled]+$kill5); $thugskilledE=fixinput($enemy[thugskilled]+$killE); $hitmenkilledE=fixinput($enemy[hitmenkilled]+$killE2); $bodyguardskilledE=fixinput($enemy[bodyguardskilled]+$killE3); $$punkskilledE=fixinput($enemy[$punkskilled]+$killE4); $hustlersE=fixinput($enemy[hustlerskilled]+$killE5); $killC=commas($kill+$kill2+$kill3+$kill4+$kill5); $killEC=commas($killE+$killE2+$killE3+$killE4+$killE5); echo "<h1>Your rid is $rid</h1>"; mysql_query("INSERT INTO $tab[mail] (rid,src,dest,msg,time,inbox) VALUES ('$rid','$id','$enemy[id]','$addmsg <a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]</a> invaded your club. <font color=#8F92E8>$killC</font> of your boys were killed. <font color=#8F92E8>$killEC</font> of <a href=pimp.php?pmp=$user[pimp]&rid=$rid>$user[pimp]'s</a> bouncers were also killed in the attack. $stealmsg','$time',1);") or die("Query failed: $query\n" . mysql_error()); mysql_query("UPDATE $tab[pimp] SET thugs='$thug', thugskilled='$thugskilled', hitmen='$hitmen', hitmenkilled='$hitmenkilled',bodyguards='$bodyguards', bodyguardskilled='$bodyguardskilled',cash='$cash' WHERE id='$id' AND rid='$rid'") or die("Query failed: $query\n" . mysql_error()); mysql_query("UPDATE $tab[pimp] SET hoes='$hoesE', hoeskilled='$hoeskilledE', bootleggers='$bootleggersE', bootleggerskilled='$bootleggerskilledE',dealers='$dealersE', dealerskilled='$dealerskilledE',punks='$punksE', punkskilled='$punkskilledE',hustlers='$hustlersE', hustlerskilled='$hustlerskilledE',cash='$cashE' WHERE id='$enemy[id]' AND rid='$rid'") or die("Query failed: $query\n" . mysql_error()); ?> i can be contacted on msn at [email protected] thanks in advance Link to comment https://forums.phpfreaks.com/topic/108645-need-some-help-to-debug-a-attack-for-online-game-help-please-will-pay/ Share on other sites More sharing options...
alcapone Posted June 4, 2008 Author Share Posted June 4, 2008 nobody can help with this Link to comment https://forums.phpfreaks.com/topic/108645-need-some-help-to-debug-a-attack-for-online-game-help-please-will-pay/#findComment-557419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.