Jump to content
MakeWebGames

ags_cs4????


boionfire81

Recommended Posts

I always support my modules :) and try something like this

 

if($ir['guard'] >= time() && $ir['guardon']) {
echo "This user is protected against blocks.";
$h->endpage();
exit;
}

 

or a simple

 

if($ir['guardon']) {
echo "This user is protected against blocks.";
$h->endpage();
exit;
}

Cool thanks man! Think there is a way to put a random hp reduction in there too? Like from 1-10%? No hosp time though.

 

Edited by boionfire81
my bad forgot db query can still be run when the if is
Link to comment
Share on other sites

Oh wow, look at that math lol!

I came up with

 

else if($ir['guardon'] = 1) {
$amt=rand(20,200);
   echo "Some say protection is for sissys. Well this sissy just took some of your health. So let that be a lesson, keeping protection is a good thing!";
   $db->query("UPDATE `users` SET `hp` = `hp` - (`maxhp`/$amt) WHERE `userid` = $userid");
   $h->endpage();
   exit;
}  

 

Edited by boionfire81
Just noticed I didn't check for negative values -.-
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...