Jump to content
MakeWebGames

Recommended Posts

Posted

This Was Asked As A Mod. What It Does; Makes your BraveBar Not Go Up EveryTime You Gain A Level Instead To Upgrade It You Have To Do Crimes And Gain CrimeEXP This Encourages Players to Be More Active And Do More Crimes. So Here It Is:

Firstly Run These In PHPMyAdmin:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

In Global_Func.php Find Function Check_Level And Replace With This:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Then In The Same File Find ?> (Or The End) And Add Before:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then Thats It If You Want To Add Brave Level Any Where Use This

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I Will Update Post In A Min Using Sprinf (learning Sprintf From Reading it & About It)

Thanks For Reading Any FeedBack Is Good (bad I'm not bothered about it tells me what i can do better) Danny696

*Updated Using Sprinf* - Danny696 Hope It Works

Posted

Re: Crime Update

This is what I use. Pretty much the same, but with a maximum maxbrave (100 in this example) and some different gain per level, and different formulas to level up a bravelevel.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Posted

Re: Crime Update

WithOut Using Sprintf:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Posted

Re: Crime Update

you dont really need a new function danny696 but im a prude for saving space :P

could really shorten that right down to simply having one column set out for their exp and work out the brave from that ie

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

increases the users brave by one for every time their experience reaches above 75* by there current brave of course you can alter that to make it harder or easier to gain brave but that way is simple and effective just put it in the hourly cron or something to update for all users and boom job done no function needed lots of space save etc etc

well my 2 cents

  • 2 weeks later...
Posted

Re: Crime Update

well i altered it a bit and works perfect for me and you should of made a backup before you were going to make a big change

  • 5 months later...
  • 4 months later...
Posted

Little error

CHANGE

function check_brave()

{

global $db;

global $ir,$c,$userid;

$ir['cEXPneeded']=(int) ($ir['braveLVL']*500);

if($ir['crimeexp'] >= $ir['cEXPneeded'])

{

$ir['braveLVL']+=1

$ir['brave']+=2;

$ir['maxbrave']+=2;

$ir['cEXPneeded']=(int) ($ir['braveLVL']*500);

$query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], $ir['maxbrave'], $ir['braveLVL'], $ir['braveLVL'], $ir['userid']);

$db->query($query);

}

}

 

TO

function check_brave()

{

global $db;

global $ir,$c,$userid;

$ir['cEXPneeded']=(int) ($ir['braveLVL']*500);

if($ir['crimeexp'] >= $ir['cEXPneeded'])

{

$ir['braveLVL']+=1;

$ir['brave']+=2;

$ir['maxbrave']+=2;

$ir['cEXPneeded']=(int) ($ir['braveLVL']*500);

$query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], $ir['maxbrave'], $ir['braveLVL'], $ir['braveLVL'], $ir['userid']);

$db->query($query);

}

}

Posted

change $query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'],

to $query = sprintf("UPDATE users SET %s=$a+2,%s=%s+2,%s=%s+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'],

Posted

lmao let me get back to you on this

Ok after Danny helping me fix the level check and me jacking with the brave check for 2hours, i have it all working.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

thanks to everybody that had a hand in helping me get what i wanted for my game. This has been tested and works great :!: :thumbup:

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