Jump to content
MakeWebGames

hey


TipZ
 Share

Recommended Posts

hi.

i maked a rank script but now i just need it to run hmm every one can help me ????

as it is now you have to go to the page where i placed the rank script

 

<?php 
include "globals.php";

if ($ir['rankxp'] > 1)
{
$db->query("UPDATE users SET rank='starter' WHERE userid=$userid");
}
if ($ir['rankxp'] > 150)
{
$db->query("UPDATE users SET rank='Pickpocket' WHERE userid=$userid");
}		 
if ($ir['rankxp'] > 400)
{
$db->query("UPDATE users SET rank='Criminal' WHERE userid=$userid");
}
if ($ir['rankxp'] > 550)
{
$db->query("UPDATE users SET rank='Dealer' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 700)
{
$db->query("UPDATE users SET rank='Thug' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 1000)
{
$db->query("UPDATE users SET rank='Leader' WHERE userid=$userid");
}
if ($ir['rankxp'] > 2500)
{
$db->query("UPDATE users SET rank='Con Artist' WHERE userid=$userid");
}
if ($ir['rankxp'] > 5000)
{
$db->query("UPDATE users SET rank='Caporegime' WHERE userid=$userid");
}
if ($ir['rankxp'] > 10000)
{
$db->query("UPDATE users SET rank='Hitman' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 15000)
{
$db->query("UPDATE users SET rank='Crimelord' WHERE userid=$userid");
}
if ($ir['rankxp'] > 32000)
{
$db->query("UPDATE users SET rank='Piciotto' WHERE userid=$userid");
}	
if ($ir['rankxp'] > 40000)
{
$db->query("UPDATE users SET rank='Contabile' WHERE userid=$userid");
}	
if ($ir['rankxp'] > 57000)
{
$db->query("UPDATE users SET rank='Boss' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 65000)
{
$db->query("UPDATE users SET rank='Kingpin' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 80000)
{
$db->query("UPDATE users SET rank='Consiglieri' WHERE userid=$userid");
}
if ($ir['rankxp'] > 110000)
{
$db->query("UPDATE users SET rank='Godfather' WHERE userid=$userid");
} 
if ($ir['rankxp'] > 210000)
{
$db->query("UPDATE users SET rank='Don' WHERE userid=$userid");
} 
if ($ir['rankxp'] > 310000)
{
$db->query("UPDATE users SET rank='Legendary Godfather' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 410000)
{
$db->query("UPDATE users SET rank='Legendary Don' WHERE userid=$userid");
}
if ($ir['rankxp'] > 490000)
{
$db->query("UPDATE users SET rank='Untouchable Don' WHERE userid=$userid");
}
?>

 

any one know how i get it to run automatic ??

Link to comment
Share on other sites

Re: hey

use a cron, here you go, set it to run whenever you want, hourly or daily,

 

<?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;

if ($ir['rankxp'] > 1)
{
$db->query("UPDATE users SET rank='starter' WHERE userid=$userid");
}
if ($ir['rankxp'] > 150)
{
$db->query("UPDATE users SET rank='Pickpocket' WHERE userid=$userid");
}		 
if ($ir['rankxp'] > 400)
{
$db->query("UPDATE users SET rank='Criminal' WHERE userid=$userid");
}
if ($ir['rankxp'] > 550)
{
$db->query("UPDATE users SET rank='Dealer' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 700)
{
$db->query("UPDATE users SET rank='Thug' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 1000)
{
$db->query("UPDATE users SET rank='Leader' WHERE userid=$userid");
}
if ($ir['rankxp'] > 2500)
{
$db->query("UPDATE users SET rank='Con Artist' WHERE userid=$userid");
}
if ($ir['rankxp'] > 5000)
{
$db->query("UPDATE users SET rank='Caporegime' WHERE userid=$userid");
}
if ($ir['rankxp'] > 10000)
{
$db->query("UPDATE users SET rank='Hitman' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 15000)
{
$db->query("UPDATE users SET rank='Crimelord' WHERE userid=$userid");
}
if ($ir['rankxp'] > 32000)
{
$db->query("UPDATE users SET rank='Piciotto' WHERE userid=$userid");
}	
if ($ir['rankxp'] > 40000)
{
$db->query("UPDATE users SET rank='Contabile' WHERE userid=$userid");
}	
if ($ir['rankxp'] > 57000)
{
$db->query("UPDATE users SET rank='Boss' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 65000)
{
$db->query("UPDATE users SET rank='Kingpin' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 80000)
{
$db->query("UPDATE users SET rank='Consiglieri' WHERE userid=$userid");
}
if ($ir['rankxp'] > 110000)
{
$db->query("UPDATE users SET rank='Godfather' WHERE userid=$userid");
} 
if ($ir['rankxp'] > 210000)
{
$db->query("UPDATE users SET rank='Don' WHERE userid=$userid");
} 
if ($ir['rankxp'] > 310000)
{
$db->query("UPDATE users SET rank='Legendary Godfather' WHERE userid=$userid");
}  
if ($ir['rankxp'] > 410000)
{
$db->query("UPDATE users SET rank='Legendary Don' WHERE userid=$userid");
}
if ($ir['rankxp'] > 490000)
{
$db->query("UPDATE users SET rank='Untouchable Don' WHERE userid=$userid");
}

$db->disconnect();
?>
Link to comment
Share on other sites

Re: hey

 

use a cron, here you go, set it to run whenever you want, hourly or daily,

Hmm, cron could work..not the best of ideas. But the cron you provided will not, $userid & $ir are not defined.

Try..

 

<?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 rank = 'starter' WHERE `rankxp` > 1");

$db->query("UPDATE users SET rank='Pickpocket' WHERE `rankxp` > 150");

$db->query("UPDATE users SET rank='Criminal' WHERE `rankxp` > 400");

$db->query("UPDATE users SET rank='Dealer' WHERE `rankxp` > 550");

$db->query("UPDATE users SET rank='Thug' WHERE `rankxp` > 700");

$db->query("UPDATE users SET rank='Leader' WHERE `rankxp` > 1000");

$db->query("UPDATE users SET rank='Con Artist' WHERE `rankxp` > 2500");

$db->query("UPDATE users SET rank='Caporegime' WHERE `rankxp` > 5000");

$db->query("UPDATE users SET rank='Hitman' WHERE `rankxp` > 10000");

$db->query("UPDATE users SET rank='Crimelord' WHERE `rankxp` > 15000");

$db->query("UPDATE users SET rank='Piciotto' WHERE `rankxp` > 32000");

$db->query("UPDATE users SET rank='Contabile' WHERE `rankxp` > 40000");

$db->query("UPDATE users SET rank='Boss' WHERE `rankxp` > 57000");

$db->query("UPDATE users SET rank='Kingpin' WHERE `rankxp` > 65000");

$db->query("UPDATE users SET rank='Consiglieri' WHERE `rankxp` > 80000");

$db->query("UPDATE users SET rank='Godfather' WHERE `rankxp` > 110000");

$db->query("UPDATE users SET rank='Don' WHERE `rankxp` > 210000");

$db->query("UPDATE users SET rank='Legendary Godfather' WHERE `rankxp` > 310000");

$db->query("UPDATE users SET rank='Legendary Don' WHERE `rankxp` > 410000");

$db->query("UPDATE users SET rank='Untouchable Don' WHERE `rankxp` > 490000");

?>
Link to comment
Share on other sites

Re: hey

if ($ir['rankxp'] > 1) { $rank = "Rank1"; )

if ($ir['rankxp'] > 150) { $rank = "Rank2"; }

if ($ir['rankxp'] > 400) { $rank = "Rank3"; )

$result = mysql_query("UPDATE `users` SET `rank` = '".$rank."' WHERE `userid` = '".$userid."'");

if (!$result) {

echo 'Invalid query: ' . mysql_error();

$h->endpage(); // not sure if that is rite as i don't use mccodes.

die();

}

Link to comment
Share on other sites

Re: hey

 

use a cron, here you go, set it to run whenever you want, hourly or daily,

Hmm, cron could work..not the best of ideas. But the cron you provided will not, $userid & $ir are not defined.

Try..

 

<?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 rank = 'starter' WHERE `rankxp` > 1");

$db->query("UPDATE users SET rank='Pickpocket' WHERE `rankxp` > 150");

$db->query("UPDATE users SET rank='Criminal' WHERE `rankxp` > 400");

$db->query("UPDATE users SET rank='Dealer' WHERE `rankxp` > 550");

$db->query("UPDATE users SET rank='Thug' WHERE `rankxp` > 700");

$db->query("UPDATE users SET rank='Leader' WHERE `rankxp` > 1000");

$db->query("UPDATE users SET rank='Con Artist' WHERE `rankxp` > 2500");

$db->query("UPDATE users SET rank='Caporegime' WHERE `rankxp` > 5000");

$db->query("UPDATE users SET rank='Hitman' WHERE `rankxp` > 10000");

$db->query("UPDATE users SET rank='Crimelord' WHERE `rankxp` > 15000");

$db->query("UPDATE users SET rank='Piciotto' WHERE `rankxp` > 32000");

$db->query("UPDATE users SET rank='Contabile' WHERE `rankxp` > 40000");

$db->query("UPDATE users SET rank='Boss' WHERE `rankxp` > 57000");

$db->query("UPDATE users SET rank='Kingpin' WHERE `rankxp` > 65000");

$db->query("UPDATE users SET rank='Consiglieri' WHERE `rankxp` > 80000");

$db->query("UPDATE users SET rank='Godfather' WHERE `rankxp` > 110000");

$db->query("UPDATE users SET rank='Don' WHERE `rankxp` > 210000");

$db->query("UPDATE users SET rank='Legendary Godfather' WHERE `rankxp` > 310000");

$db->query("UPDATE users SET rank='Legendary Don' WHERE `rankxp` > 410000");

$db->query("UPDATE users SET rank='Untouchable Don' WHERE `rankxp` > 490000");

?>

 

thanks man its working now :)

Link to comment
Share on other sites

Re: hey

Iso, you could use as pog-one said...

 

if($ir['rankxp'] > 1) { $rank = "Newbie"; }
else if($ir['rankxp'] > 150) { $rank = "Pick Pocket"; }      
else if($ir['rankxp'] > 400) { $rank = "Criminal"; }
else if($ir['rankxp'] > 550) { $rank = "Dealer"; }
else if($ir['rankxp'] > 700) { $rank = "Thug"; }
else if($ir['rankxp'] > 1000) { $rank = "Criminal"; }
mysql_query("UPDATE users SET rank='".$rank."' WHERE userid=".$ir['userid']) or die(mysql_error());
Link to comment
Share on other sites

Re: hey

Well david, you have seen my header.php thats all i need to run in header.php the rest i run either on other scripts. But as you see, my game still loads fast with the images. Because the header has an efficient coding.

Same with FW because there are quite a few uncompressed PNG's on the header.

Link to comment
Share on other sites

Re: hey

 

True, but in some sence CSS can do some nice things :P

yeah, i have seen sites with 1 big BG image as the whole website layout it took about 5 mins to load fully

yea thats the problem, if you dont cut and slice properly and just put a hige image... it kinda sucks.

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