Jump to content
MakeWebGames

Recommended Posts

Posted

Didn't know where to post this so I posted here.

I'm looking for ags_cs4 from mccodes. I bought his protection mod, but it doesn't do anything for an attack. I'm hoping to find him for help getting it to work.

Posted

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;
}
Posted (edited)
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
Posted

You can try something like:

$one = floor(1/$ir['maxhp'])*100;
$ten = floor(10/$ir['maxhp'])*100;
$rand = rand($one,$ten);
if($rand > $ir['hp'])
{
   $rand = $ir['hp'];
}
$db->query('update users set hp = hp - '.$rand.' where userid = '.$ir['userid']);
Posted

Another way could be pretty "much the same as kyle lol"

 

$loseperc = mt_rand(1,10);
$perc = $ir['hp'] / 100 * $loseperc;
$health = $ir['hp'] - $perc;
if($health >= $ir['maxhp'])
    $health = $ir['maxhp'])
$db->query("UPDATE `users` SET `hp` = `hp` - {$health} WHERE `userid` = ".$ir['userid']);
Posted (edited)

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

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