Jump to content
MakeWebGames

Recommended Posts

Posted

Re: [V2] Cron Mods Request

<?php

include "config.php";

global $_CONFIG;

if($_GET['code'] != $_CONFIG['code']) { die(""); }

define("MONO_ON", 1);

require "class/class_db_{$_CONFIG['driver']}.php";

$db=new database;

$db->configure($_CONFIG['hostname'],

$_CONFIG['username'],

$_CONFIG['password'],

$_CONFIG['database'],

$_CONFIG['persistent']);

$db->connect();

$c=$db->connection_id;

$db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0");

$db->query("UPDATE `users` SET jail=jail-1 WHERE `jail` > 0");

$hc=$db->num_rows($db->query("SELECT * FROM users WHERE hospital > 0"));

$jc=$db->num_rows($db->query("SELECT * FROM users WHERE jail > 0"));

$db->query("UPDATE settings SET conf_value='$hc' WHERE conf_name='hospital_count'");

$db->query("UPDATE settings SET conf_value='$jc' WHERE conf_name='jail_count'");

?>

Posted

Re: [V2] Cron Mods Request

that the code that i got with the V2 mc codes

and i have had very very experienced coders have a look at them and they say nothing is wrong with them

so no i will not use code tags :-D :-D

Posted

Re: [V2] Cron Mods Request

 

that the code that i got with the V2 mc codes

and i have had very very experienced coders have a look at them and they say nothing is wrong with them

so no i will not use code tags :-D :-D

The code tags are used in the post, not in the code. It helps keep the posts from stretching out for a mile.

Posted

Re: [V2] Cron Mods Request

 

UPDATE users set will = will + maxwill/10 WHERE will < maxwill;

UPDATE users set will = maxwill WHERE will > maxwill;

Can use Least();

<?php //Only for colors..
$db->query("UPDATE `users` SET `hp` = LEAST(`hp` + (`maxhp` / 3), `maxhp`)");

Would be the same as.

<?php //Only for colors!!
$db->query("UPDATE `users` SET `hp` = `hp` + (`maxhp` / 3) WHERE `hp` < `maxhp`");
$db->query("UPDATE `users` SET `hp` = `maxhp` WHERE `hp` > `maxhp`");

:-D

Posted

Re: [V2] Cron Mods Request

 

//Why not go for the whole lot and add an IF() with using LEAST()

$db->query(
"UPDATE `users` SET 
 `brave`=LEAST(`brave`+((`maxbrave`/'10')+'0.5'), `maxbrave`), 
 `hp`=LEAST(`hp`+(`maxhp`/'3'), `maxhp`), 
 `will`=LEAST((`will`+'10'), `maxwill`), 
 `energy`=IF(`donatordays`<>'0', LEAST(`energy`+(`maxenergy`/'6'), `maxenergy`), LEAST(`energy`+(`maxenergy`/'12.5'), `maxenergy`))"
);
  • 3 months 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.

×
×
  • Create New...