Jump to content
MakeWebGames

Small Script Help


LimitedStreak

Recommended Posts

Hello there,

Long time since ive posted but im back as an active member seeking help and helping where i can :)

Anyway, i am trying to make a script where everytime you have just say 100 points, you are automatically given £1,000,000.

I know how make a script where if you have 100 points then you get given £1,000,000, if you have 200 points then you get given £1,000,000 more etc

but this will take far too long and there is an infinie maximum that can be reached so this would be time consuming.

Can anyone give me heads up on a small piece of coding that would carry a similar or same fuction so everytime you have 100 points, you will recieve £1,000,000 additional please.

Thanks in advance :)

Link to comment
Share on other sites

Put something in globals like this if statement:

 

$points = $ir['crystals'];
if(($points % 100) == 0){
 $num1= ceil($points/100);
 $payout = $num1*1000000;
 //do your db query here and update there money with the new $payout variable

}

But the fact is that something similar will only satisfy that condition if $points = 0, and obviously the outcome on the payout = 0 as well!

Link to comment
Share on other sites

if is_int($points % 100) { do something }

other than that, you need to somehow check each offer...

add a new table

let's say with userid and reward_level

on is_int($points % 100) where points are 100, is_int will return 1

add the userid and reward_level (as 1) to the table,

next check will verify that 100 points have already taken the reward, so it will only deliver on next phase , is_int($points % 100) where points are 200 is_int will return 2 etc etc etc

Edited by Lithium
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Iv just check MWG after a long time and realised that people have replied to my post and thanks for trying to help people:D. Im not sure though if you get what i mean. What i need is whenever a user gets just say 10million pounds, 1 point is added to his account so just say a user had 20 million then another 1 point would be added and if he gained 30 million then another point would be added.

Link to comment
Share on other sites

$money = $ir['money']; // Change $ir[...] to what you use for money
$minMoney = 1000000; // 1 Million, as stated above [Post #9]
if( $money %  $minMoney ) {
    /* Do query to deduct $minMoney from their money
     * Do query to add 1 point
     * Send a user an event?
     */
}

 

How's that?

  • Like 1
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...