Jump to content
MakeWebGames

adding 1/4 will pot to the game


Snatchy
 Share

Recommended Posts

I'm adding a 1/4 will pot to the game but after many attempts at gettignt he query to work right the one i have working seems to add will to over 100% which is a bit of a pain in the but.

I know there is something missing to make this work so i was just wondering if someone could help me add to it.

The query i have so far that adds 25% is this...

mysql_query("UPDATE users SET will=(will+(willmax*25/100)) WHERE userid=$userid",$c);

Now i just need to make it so it stops at 100% and doesn't go over.

any help is gratefull...

Cheers

Snatchy

Link to comment
Share on other sites

Re: adding 1/4 will pot to the game

execute a second query

UPDATE users SET will=maxwill WHERE will>maxwill

a 25% solution for the original question would be:

will=will+(maxwill/4) as any pie divided into 4 pieces = 4 x 25%

(willmax is "house will", can be confusing)

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.

 Share

×
×
  • Create New...