PHP interesse |
|
Goedenmorgen mensen..
Ik heb een paardenracescript gemaakt..
Maar nu blijkt: Als je bijvoorbeeld.. $1,000,000,000 inzet.. op groen.. win je inzet x 11.. maar als de owner dat geld niet heeft.. hoort de speler geen 11 x te krijgen.. maar alles wat de owner heeft.. dus als de owner 5,000,000,000 hoort de speler 5,000,000,000 en de casino te krijgen.. maar bij mij krijg je dus zomaar geld terwijl de casino-owner dat geld niet heeft.
Het script ziet er als volgt uit:
<?
$colors = array('Yellow','Black','Blue','Red','Cyan','Green','White','Orange','Pink','Purple');
$computer = $colors[$chance];
if($color != $computer){
$nomoney = $owner['money'] + $bet;
$query = "UPDATE `users` SET `money` = '".$nomoney."' WHERE `id` = '".$owner['id']."'";
mysql_query($query) or die(mysql_error());
$nearnings = $casino['earnings'] + $bet;
$query = "UPDATE `casino` SET `earnings` = '".$nearnings."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'";
mysql_query($query) or die(mysql_Error());
echo "Sorry. You picked <b>".$color."</b>, but <b>".$computer."</b> won. You lost <b>$".number_format($bet)."</b>.";
}
if($color == $computer){
$nmoney = $user['money'] + ($bet * $wage);
$query = "UPDATE `users` SET `money` = '".$nmoney."' WHERE `id` = '".$user['id']."'";
mysql_query($query) or die(mysql_error());
$nomoney = $owner['money'] - ($bet * $wage);
$query = "UPDATE `users` SET `money` = '".$nomoney."' WHERE `id` = '".$owner['id']."'";
mysql_query($query) or die(mysql_error());
$nearnings = $casino['earnings'] - ($bet * $wage);
$query = "UPDATE `casino` SET `earnings` = '".$nearnings."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'";
mysql_query($query) or die(mysql_Error());
echo "Congratulations. <b>".$color."</b> won. You won <b>$".number_format($bet * $wage)."</b>.";
}
if($nomoney <= 0){
$query = "UPDATE `casino` SET `owner` = '".$user['username']."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'";
mysql_query($query) or die(mysql_error());
mysql_query("UPDATE `users` SET `money` = '0' WHERE `id` = '".$owner['id']."'");
$nieuwe=($user['money']+$owner['money']);
$nieuw=($nieuwe+$bet);
mysql_query("UPDATE `users` SET `money` = '$nieuw' `id` = '".$user['id']."'");
echo "The owner went broke and you were able to pick up the casino war.";
}
}
}
?>
<? $colors = array('Yellow','Black','Blue','Red','Cyan','Green','White','Orange','Pink','Purple'); $computer = $colors[$chance]; if($color != $computer){ $nomoney = $owner['money'] + $bet; $query = "UPDATE `users` SET `money` = '".$nomoney."' WHERE `id` = '".$owner['id']."'"; $nearnings = $casino['earnings'] + $bet; $query = "UPDATE `casino` SET `earnings` = '".$nearnings."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'"; echo "Sorry. You picked <b>".$color."</b>, but <b>".$computer."</b> won. You lost <b>$".number_format($bet)."</b>."; } if($color == $computer){ $nmoney = $user['money'] + ($bet * $wage); $query = "UPDATE `users` SET `money` = '".$nmoney."' WHERE `id` = '".$user['id']."'"; $nomoney = $owner['money'] - ($bet * $wage); $query = "UPDATE `users` SET `money` = '".$nomoney."' WHERE `id` = '".$owner['id']."'"; $nearnings = $casino['earnings'] - ($bet * $wage); $query = "UPDATE `casino` SET `earnings` = '".$nearnings."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'"; echo "Congratulations. <b>".$color."</b> won. You won <b>$".number_format($bet * $wage)."</b>."; } if($nomoney <= 0){ $query = "UPDATE `casino` SET `owner` = '".$user['username']."' WHERE `casino` = 'horsetrack' AND `location` = '".$user['country']."'"; mysql_query("UPDATE `users` SET `money` = '0' WHERE `id` = '".$owner['id']."'"); $nieuwe=($user['money']+$owner['money']); $nieuw=($nieuwe+$bet); mysql_query("UPDATE `users` SET `money` = '$nieuw' `id` = '".$user['id']."'"); echo "The owner went broke and you were able to pick up the casino war."; } } } ?>
|