PHP interesse |
|
Hallo mensen..
Ik heb mijn eigen RPG game..
Maar Arm Wrestling doet het niet helemaal zoals het hoort..
Diegene die de wedstrijd wint.. krijgt het geld dubbel.. dus stel je hebt 1000 dollar.. je gaat een match aan van 1000.. en je wint..dan heb je 3000.. terwijl je 2000 hoort te hebben.. kunnen jullie mij hierbij helpen??
Het script ziet er als volg uit:
<?
if($user['level'] > $oppon['level'] || ($user['level'] == $oppon['level'] && $user['exp'] > $oppon['exp'])){
$nmoney = $user['money'] + ($match['bet'] * 2);
$your_stats[0]++;
$nwl = implode(":",$your_stats);
MySql_Query("UPDATE `users` SET `money` = '".$nmoney."', `wl` = '".$nwl."' WHERE `id` = '".$user['id']."'");
$oppon_stats[1]++;
$nwl = implode(":",$oppon_stats);
MySql_Query("UPDATE `users` SET `wl` = '".$nwl."' WHERE `id` = '".$oppon['id']."'");
$msg = "You have lost your arm wrestling match.";
MySql_Query("INSERT INTO `messages` (`from`,`to`,`date`,`message`) VALUES ('Notification','".$oppon['username']."','".date("Y-m-d H:i:s")."','".$msg."')");
MySql_Query("DELETE FROM `matches` WHERE `id` = '".$match['id']."'");
echo "You won the match.";
}
else{
$nmoney = $oppon['money'] + ($match['bet'] * 2);
$oppon_stats[0]++;
$nwl = implode(":", $oppon_stats);
MySql_Query("UPDATE `users` SET `money` = '".$nmoney."', `wl` = '".$nwl."' WHERE `id` = '".$oppon['id']."'");
$your_stats[1]++;
$nwl = implode(":", $your_stats);
MySql_Query("UPDATE `users` SET `wl` = '".$nwl."' WHERE `id` = '".$user['id']."'");
$msg = "You have won your arm wrestling match.";
MySql_Query("INSERT INTO `messages` (`from`,`to`,`date`,`message`) VALUES ('Notification','".$oppon['username']."','".date("Y-m-d H:i:s")."','".$msg."')");
MySql_Query("DELETE FROM `matches` WHERE `id` = '".$match['id']."'");
echo "You lost the match.";
?>
<? if($user['level'] > $oppon['level'] || ($user['level'] == $oppon['level'] && $user['exp'] > $oppon['exp'])){ $nmoney = $user['money'] + ($match['bet'] * 2); $your_stats[0]++; MySql_Query("UPDATE `users` SET `money` = '".$nmoney."', `wl` = '".$nwl."' WHERE `id` = '".$user['id']."'"); $oppon_stats[1]++; MySql_Query("UPDATE `users` SET `wl` = '".$nwl."' WHERE `id` = '".$oppon['id']."'"); $msg = "You have lost your arm wrestling match."; MySql_Query("INSERT INTO `messages` (`from`,`to`,`date`,`message`) VALUES ('Notification','".$oppon['username']."','".date("Y-m-d H:i:s")."','".$msg."')"); MySql_Query("DELETE FROM `matches` WHERE `id` = '".$match['id']."'"); echo "You won the match."; } else{ $nmoney = $oppon['money'] + ($match['bet'] * 2); $oppon_stats[0]++; MySql_Query("UPDATE `users` SET `money` = '".$nmoney."', `wl` = '".$nwl."' WHERE `id` = '".$oppon['id']."'"); $your_stats[1]++; MySql_Query("UPDATE `users` SET `wl` = '".$nwl."' WHERE `id` = '".$user['id']."'"); $msg = "You have won your arm wrestling match."; MySql_Query("INSERT INTO `messages` (`from`,`to`,`date`,`message`) VALUES ('Notification','".$oppon['username']."','".date("Y-m-d H:i:s")."','".$msg."')"); MySql_Query("DELETE FROM `matches` WHERE `id` = '".$match['id']."'"); echo "You lost the match."; ?>
Ontani edit: - Tags gebruiken[/code]
|