Jump to content
MakeWebGames

Recommended Posts

Posted

Question Re-Vamp.

I'm going to use the Ciggarrettes mod to do the following.

When a user Starts Smoking, they will gain 1 or 2 points in a certain userstat. Ciggs will be a bit pricey but not real pricey.

Every..Hour? The users stats will drop by 1 or 2.

May even do the higher the addiction the more they drop....or raise..

My question would be on the Hour_cron

$db->query("UPDATE users SET userstats=userstats-2 WHERE userstats > 0 AND smoking > 0")

Would that cron work ?

Posted

That would not work, try

if($ir['smoking'] >= 1)
{
$db->query("UPDATE userstats SET strenght=strenght-2 ..... WHERE userid=".$ir['userid']."");
exit;
}

replace .. with agility, guard, labour and iq

Posted

That wont work in a cron danny

This is untested, but in your hour cron try

 

 

$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.agility=us.agility-2 WHERE us.agility > 1 AND u.smoking > 0");

 

of course u can change the agility to a different stat if you want

Posted

I'll give them both a shot.

I'm also going to change the cig mod to a Glass of Blood mod for my vampires.

 

But they won't matter whether they start or not.

Just going to have their stats drop by 1 or 2 points every hour, as that's what happens when they don't get their Blood.

Thanks everyone, appreciate the help.

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