Jump to content
MakeWebGames

Bug Fix Help


Mr-Scripts

Recommended Posts

A Player has pointed out that if you are banned on my game and start again and revive that account it becomes unbanned ( credit option )

bu what can i add to my exsiting code to prevent this

 

}}

elseif($type==3){
$reviveuser = $_POST['reviveuser'];
if($fetch->points < 1000){ echo "	<table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center><font color=red>You do not have enough credits to revive $reviveuser!</td></tr></table><br>"; }
elseif($fetch->points >= 1000){
$query = mysql_query("SELECT * FROM users WHERE username='$reviveuser'");
$rows = mysql_num_rows($query);
$userdata = mysql_fetch_object($query);
if ($rows == "0"){ echo "	<table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center>The username entered to revive is invalid."; }else{ 
if ($userdata->status == "Alive"){ echo "	<table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0><tr><td class=notice align=center><center>That user is still alive!"; }else{
mysql_query("UPDATE users SET status='Alive',health='100' WHERE username='$reviveuser'");
mysql_query("UPDATE users SET points=points-1000 WHERE username='$username'");
mysql_query("INSERT INTO `spentcredits` (`id`, `username`, `product`, `cost`, `date`) VALUES ('', '$username', 'Revive - $reviveuser', '1000','$date')");
echo "	<table border=0 bordercolor=black align=center cellpadding=2 cellspacing=0>

<tr><td class=notice align=center><center><font color=green>You have revived $reviveuser they can now continue playing!</td>
</tr>
</table><br>"; }}}}
Edited by Mr-Scripts
Link to comment
Share on other sites

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.   Paste as plain text instead

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