Jump to content
MakeWebGames

Recommended Posts

Posted
Mhm, that won't let anyone attack even if there offline

Seriously? Spoon feeding incoming...

 

if ($r['laston'] > (time() - 300)) {
   echo 'You can not attack people while they are online.';
   $h->endpage;
   exit;
}

 

*sigh*

Posted
Seriously? Spoon feeding incoming...

 

if ($r['laston'] > (time() - 300)) {
   echo 'You can not attack people while they are online.';
   $h->endpage;
   exit;
}

 

*sigh*

I honestly thought what I posted was already too much. Sheesh.

Posted
Still doesn't work, so maybe you should put the right spoon in my mouth so I can be fed.

Since $r defines players in the attack file, the code is correct.

Error is therefore on your part - so put it in the right place!

Posted

Assuming your using mccodes in attack.php try

if($r['laston'] >= time()-15*60)

{

print "You cannot players that are online.<br />

<a href='index.php'>> Back</a>";

$h->endpage();

$_SESSION['attacking']=0;

$ir['attacking']=0;

$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");

exit;

}

 

If you get any problems give me a shout and will see what I can do :)

Posted
$_SESSION['attacking']=0;
$ir['attacking']=0;
$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");

There's no need for this.

If he's trying to stop them from attacking at all, putting the previously given conditionals at the beginning of the file will do exactly what he wants.

The fact that it's "not working" means he obviously doesn't know where it goes.

In which case, I must ask, why is this guy working on the code at all?

Order of operations applies to more than just math.

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