Jump to content

PHP Mafia Game [HELP]


Scouse

Recommended Posts

Hey guys, my friends have just recently created an online mafia game, I have come aross a few exploits, I can deposit cash into my "game bank" and also into my "swiss game bank" at the same time, I think this may have something do to with not using transaction within their scripts, They need some help..

 

Anyone have any ideas?

Link to comment
Share on other sites

if (isset($_POST['swissdeposit'])) {

if(!$swissdeposit){echo'<font color=white size=1 face=verdana><b>You did not enter an amount to deposit.</b></font>';}

elseif($userswiss != '0'){echo'<font color=white size=1 face=verdana>You can only insert money into your swiss when it is empty.</font>';}

elseif($swissdeposit > $usermoney){echo"<font color=white size=1 face=verdana>You don't have enough money.</font>";}

elseif($swissdeposit > '99999999999'){echo'<font color=white size=1 face=verdana><b>You cannot have more than $<b>99,999,999,999</b> in your swiss bank.</font>';}

elseif($entertainer != '0'){echo'<font color=white face=verdana size=1>As entertainer you cannot use this feature</font>';}

else{

mysql_query("UPDATE users SET swiss = '$swissdeposit', money = money - '$swissdeposit' WHERE username = '$username'");

echo"<font color=white size=1 face=verdana>You deposited $<b>$swissdeposittwo</b> into your swiss bank account.</font>";}

}

 

elseif($swissdeposit > $usermoney){echo"<font color=white size=1 face=verdana>You don't have enough money.</font>";}

Link to comment
Share on other sites

if (isset($_POST['swissdeposit'])) {
if(!$swissdeposit){echo'<font color=white size=1 face=verdana><b>You did not enter an amount to deposit.</b></font>';}
elseif($userswiss != '0'){echo'<font color=white size=1 face=verdana>You can only insert money into your swiss when it is empty.</font>';}
elseif($swissdeposit > $usermoney){echo"<font color=white size=1 face=verdana>You don't have enough money.</font>";}
elseif($swissdeposit > '99999999999'){echo'<font color=white size=1 face=verdana><b>You cannot have more than $<b>99,999,999,999</b> in your swiss bank.</font>';}
elseif($entertainer != '0'){echo'<font color=white face=verdana size=1>As entertainer you cannot use this feature</font>';}
else{
mysql_query("UPDATE users SET swiss = '$swissdeposit', money = money - '$swissdeposit' WHERE username = '$username'");
echo"<font color=white size=1 face=verdana>You deposited $<b>$swissdeposittwo</b> into your swiss bank account.</font>";}
}

Right,  $usermoney represents how much money the user has, lets say the user has £5. If the user tries to put £5 into his bank it will remove £5 from his money and add it to his bank account., then if the user tries to do the same thing again, he will get the error 

   elseif($swissdeposit > $usermoney){echo"<font color=white size=1 face=verdana>You don't have enough money.</font>";}

................ BUT if you open 2 windows, and try and put £5 into your bank at the EXACT same time, it bypasses "You don't have enough money." error, and adds £10 into the bank account

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.