Jump to content
MakeWebGames

Daily bank interest event


MajikalJoker
 Share

Recommended Posts

okay so.... ive been trying so many ways to do this but can not figure it out...

im wanting o make it to where players get a daily event telling them how much interest they got in their bank for the day.

 

ive tried about 8 different ways to do it but i can not get it to work, i cant get it to call the bank interest amount without breaking the script, and if i do it without i can make an event happen but it does not show how much they got and its blank on almost all info.....

 

can anyone help?

Link to comment
Share on other sites

Then post the ways you have tried, and people can help fix your code to do what you want.

Bottle feeding you won't help you out much - you won't learn to debug, process plan, etc.

Posting what you have, and working along with suggestions will give you a far more thorough understanding.

Link to comment
Share on other sites

Here you go one try
aWYoJHJbJ2RvbmF0b3JkYXlzJ10gPT0gMCkNCgl7DQoJJGRiLT5xdWVyeSgiSU5TRVJUIElOVE8gZXZlbnRzIFZBTFVFUygnJywneyRyWyd1c2VyaWQnXX0nLCd1bml4X3RpbWVzdGFtcCgpJywnMCcsJ0NvbmdyYXR1bGF0aW9ucywgeW91IGdhaW5lZCAkaW50cyEnKSIpOw0KCX0NCgllbHNlDQoJew0KCSRkYi0+cXVlcnkoIklOU0VSVCBJTlRPIGV2ZW50cyBWQUxVRVMoJycsJ3skclsndXNlcmlkJ119JywndW5peF90aW1lc3RhbXAoKScsJzAnLCdDb25ncmF0dWxhdGlvbnMsIHlvdSBnYWluZWQgJGludHNkIScpIik7DQoJfQ==

 

Also not exact but very similar 

2471643d2464622d3e7175657279282253454c454354202a2046524f4d20757365727320574845524520646f6e61746f7264617973203e203022293bda97768696c65282472643d2464622d3e66657463685f726f77282471642929da97bda96576656e745f616464282472645b27757365726964275d2c22596f75206761696e20736f6d6520696e74657372657374222c2463293bda97d

Link to comment
Share on other sites

2 hours ago, Venox606 said:

Here you go one try
 

if($r['donatordays'] == 0){
	$db->query("INSERT INTO events VALUES('','{$r['userid']}','unix_timestamp()','0','Congratulations, you gained $ints!')");
}else{
	$db->query("INSERT INTO events VALUES('','{$r['userid']}','unix_timestamp()','0','Congratulations, you gained $intsd!')");
}

 

haha definitely made me laugh, you do know if you quote encoded code it decodes it??

  • Haha 1
Link to comment
Share on other sites

1 hour ago, MajikalJoker said:

thank you for the help, we are not 100% sure that works due to the fact that everytime we try to add something like

 

$ints= $r['bankmoney']/100*3 ; $intsd= $r['bankmoney']/100*8 ; $ints=money_formatter($ints); $intsd=money_formatter($intsd);

$ints= $r['bankmoney']/100*3 ;
$intsd= $r['bankmoney']/100*8 ;
$ints=money_formatter($ints);
$intsd=money_formatter($intsd);

anywhere in the daily con it breaks the whole thing

Add me on discord URBANZ#0001

Can help quicker on there

  • Like 1
Link to comment
Share on other sites

Here is mine, I just copied and pasted 😄

    if (17 == date('G')) {
        $qm = $db->query("SELECT userid, bankmoney FROM users WHERE bankmoney >= '1'");
        while ($rm = $db->fetch_row($qm)) {
            $money = $rm['bankmoney']/100*2;
            event_add($rm['userid'], "Your Bank Interest of \$<span class=green>".number_format($money)."</span> has been credited to your bank account.", $c);
        }
        $db->query('UPDATE users SET bankmoney=bankmoney+(bankmoney/100*2) WHERE bankmoney > 0');
    }

Snapshot of output. attached 

Opera Snapshot_2021-12-17_143241_infamouswars.mygamesonline.org.png

Edited by peterisgb
added output
  • Like 1
Link to comment
Share on other sites

3 hours ago, peterisgb said:

Here is mine, I just copied and pasted 😄

    if (17 == date('G')) {         $qm = $db->query("SELECT userid, bankmoney FROM users WHERE bankmoney >= '1'");         while ($rm = $db->fetch_row($qm)) {             $money = $rm['bankmoney']/100*2;             event_add($rm['userid'], "Your Bank Interest of \$<span class=green>".number_format($money)."</span> has been credited to your bank account.", $c);         }         $db->query('UPDATE users SET bankmoney=bankmoney+(bankmoney/100*2) WHERE bankmoney > 0');     }

    if (17 == date('G')) {
        $qm = $db->query("SELECT userid, bankmoney FROM users WHERE bankmoney >= '1'");
        while ($rm = $db->fetch_row($qm)) {
            $money = $rm['bankmoney']/100*2;
            event_add($rm['userid'], "Your Bank Interest of \$<span class=green>".number_format($money)."</span> has been credited to your bank account.", $c);
        }
        $db->query('UPDATE users SET bankmoney=bankmoney+(bankmoney/100*2) WHERE bankmoney > 0');
    }

Snapshot of output. attached 

Opera Snapshot_2021-12-17_143241_infamouswars.mygamesonline.org.png

is this used in the daily cron?

Link to comment
Share on other sites

  • 3 weeks later...

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