Jump to content
MakeWebGames

Recommended Posts

Posted

i have made a racer with exp to gain lvl's

i want the EXP to be gained from races won

if($stats_y > $stats_o)
{
$winner=$ir['username'];
$winnings=$bet*2;
$rexp1=($r['rlevel']/$ir['rlevel']);
if($bet > 0)
{
$notes="{$r['challenged']} won \$$winnings"; 
mysql_query("UPDATE users SET money=money+$winnings, rexp=rexp+$rexp1, cars_races_income=cars_races_income+$bet,cars_races_won=cars_races_won+1 WHERE userid={$r['chCHD']}", $c);
mysql_query("UPDATE users SET cars_races_income=cars_races_income-$bet,cars_races_lost=cars_races_lost+1 WHERE userid={$r['chCHR']}", $c);

}

 

and repeat it for other types of racing

it doesnt update my racer exp though

Posted

Re: [V2]Racer Exp doesnt increase

$r['rlevel'] = opponent race level

$ir['rlevel'] = your level

$r['rlevel'] = 1

$ir['rlevel'] = 3

$rexp1 = 1/3

$rexp1 = floor(0.33) or $rexp1 = round(0.33) will make $rexp1 = 0

This is just an example of what can be, yet i don't know about it, though play with the $rexp1 values and check it

Posted

Re: [V2]Racer Exp doesnt increase

well i have been trying this is why i posted it here lol.

im not sure if my variable's math is labeled wrong or if im not inserting it right...

because the races_won and race income all update to myphpadmin

and i have fixed it to where no errors pop up but its not updating rexp

$ir should be me right

$r should be you

in this file it seems both are labeled $r['chCHD'] and $r['chCHR']

for challenged and challenger

would i need to update my Rexp according to the users $r['chCHD'] and $r['chCHR']

and how would i do this

Posted

Re: [V2]Racer Exp doesnt increase

can't answer... unless you show more code, it'll be hard to come to anyone to give you a correct answer, or even some guidance, unless someone has the same files as you and can help you with that

Posted

Re: [V2]Racer Exp doesnt increase

yea i want it so they only gain for betted and High stakes racing

i added rlevel for Racer level

i dont think it is calling their level or something because 1/1=1 should still gain exp

right now i have it set to $rexp1=1/3

and its working but i want it to be rlevel/rlevel

 

i dont want to post the whole code cause idk if its a mod that was paid for i bought the game from somebody and it was on the site already

Posted

Re: [V2]Racer Exp doesnt increase

 

...$rexp1 = floor(0.33) or $rexp1 = round(0.33) will make $rexp1 = 0..

Why you rounding 0.33? it will result in 0

Posted

Re: [V2]Racer Exp doesnt increase

 

...$rexp1 = floor(0.33) or $rexp1 = round(0.33) will make $rexp1 = 0..

Why you rounding 0.33? it will result in 0

Really? damn i didn't knew that :S

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