Hi
I ned help with this code
is something wrong with it?
The Sentry Skill upgarde didn’t work! Why?
This is the code:
function Trainupgrade($user,$type)
{
if($type=='spy'){
$pris=pow(2,$user->currentSpySkill)*12000;
if($pris <= ($user->gold+$user->bank)){
if($pris>$user->gold){
$bank=$pris-$user->gold;
$pris=$user->gold;
}
$q = @mysql_query("update `UserDetails` set currentSpySkill=currentSpySkill+'1', gold=gold-'$pris', bank=bank-'$bank' where ID='$user->ID' ");
}else return 'NO GOLD LEFT!!!';}
if($type=='spy'){
$pris=pow(2,$user->currentSentrySkill)*12000;
if($pris <= ($user->gold+$user->bank)){
if($pris>$user->gold){
$bank=$pris-$user->gold;
$pris=$user->gold;
}
$q = @mysql_query("update `UserDetails` set currentSentrySkill=currentSentrySkill+'1', gold=gold-'$pris', bank=bank-'$bank' where ID='$user->ID' ");
}else return 'NO GOLD LEFT!!!';}
if($type=='bank'){
$pris=pow(2,$user->bankSkill)*100000;
if($pris <= ($user->gold+$user->bank)){
if($pris>$user->gold){
$bank=$pris-$user->gold;
$pris=$user->gold;
You actually showed some gratitude to what we are doing, asked us if we could assist you, gave us some more information with which we could actually do something, and I’ve put some effort into looking into your problem and finding out what’s wrong.
I took a glance at your code and noticed that you use the following for both Spy Skill upgrade and the Sentry skill upgrade: