Jump to content
MakeWebGames

Recommended Posts

Posted

Hey, thanks for coming to this topic :lol:

This mod simply works out your accuracy by taking your total hits and dividing it by your total misses and then it multiplies that answer by 100. A simple maths equation.

First inject these queries.

You're unable to view this code.

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

Just in case anybody doesn't understand the 'default 0;' it basically puts the user integer as a default number as 0. It helps the game instead of resetting the whole thing or putting it in register. If you don't understand this, pretend i never wrote it :-o

Then open up attack.php

In line 241, you should find;

You're unable to view this code.

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

If not search for that.

Underneath this add

You're unable to view this code.

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

Then above this; line 189 add

$db->query("UPDATE users SET totalmisses=totalmisses+1 WHERE userid=$userid",$c);

Line 189 should be

You're unable to view this code.

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

Finally finished, open up index.php, or the file which takes the users to their 'Home'/'Crib' find

You're unable to view this code.

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

Underneath it add

You're unable to view this code.

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

Thats the maths equation :roll:

Then above

You're unable to view this code.

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

Add

You're unable to view this code.

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

 

That should be it, any problems add my msn; [email protected]

Thanks, i will also be adding more mods as i go

Have fun and +1 me if this comes to use

Posted

Re: [V2] New Small Accuracy Mod [V2]

I do agree it is a good statistic.. and the bar sounds great... You could do bars for everything tho, e.g. attacks won to attacks lost, crimes etc.. pretty nift.. could add a statistics page with bars for all the statistics XD... Ty for the idea.

Posted

Re: [V2] New Small Accuracy Mod [V2]

 

You're unable to view this code.

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

 

wrong formula :-)

it should be...

$acc= ($ir['totalhits']+$ir['totalmisses']) / $ir['totalhits'] *100

Posted

Re: [V2] New Small Accuracy Mod [V2]

Tobats, to get a percent of a number you convert it into a fraction then multiply it by 100. Your method may work but it is not the best way to do it. The way you will do it is like this.

percent.png

That way you get a fraction which as a decimal is between 0 and 1 then multiply it by 100 to make in between 0 and 100 :)

Guest Sniko`
Posted

Re: [V2] New Small Accuracy Mod [V2]

 

Tobats, to get a percent of a number you convert it into a fraction then multiply it by 100. Your method may work but it is not the best way to do it. The way you will do it is like this.

percent.png

That way you get a fraction which as a decimal is between 0 and 1 then multiply it by 100 to make in between 0 and 100 :)

Good Maths hehe

Posted

Re: [V2] New Small Accuracy Mod [V2]

i have a problem ive done everything you have sead but it wont work

You're unable to view this code.

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

 

heres index2.php:

You're unable to view this code.

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

Posted

Re: [V2] New Small Accuracy Mod [V2]

Your Accuracy $acc

<font color='green'>Total Hits:</font> {$ir['totalhits']}

<font color='red'>Total Misses:</font> {$ir['totalmisses']}

</table>

<hr><h3>Stats Info:</h3>";

There's your fix.... Now place it :-P

Posted

Re: [V2] New Small Accuracy Mod [V2]

 

Tobats, to get a percent of a number you convert it into a fraction then multiply it by 100. Your method may work but it is not the best way to do it. The way you will do it is like this.

percent.png

That way you get a fraction which as a decimal is between 0 and 1 then multiply it by 100 to make in between 0 and 100 :)

ok.. let me just correct the previous formula i posted. It should be..

$acc= $ir['totalhits'] / ($ir['totalhits']+$ir['totalmisses']) *100

 

let's try using real numbers.

totalhits= 50

totalmiss= 50

Just by looking at the numbers. I'd say my accuracy would be 50%, right? :roll:

Using your formula

50 / 50 * 100 = 100%. :-D

Guest Sniko`
Posted

Re: [V2] New Small Accuracy Mod [V2]

Whats the formula, im confuzzled

Posted

Re: [V2] New Small Accuracy Mod [V2]

 

Whats the formula, im confuzzled

$acc= $ir['totalhits'] / ($ir['totalhits']+$ir['totalmisses']) *100

Posted

Re: [V2] New Small Accuracy Mod [V2]

 

wats this mod for

This mod basically tells the user their overall accuracy, hits and misses. It's a small mod which soon will be added to HOF

Posted

Re: [V2] New Small Accuracy Mod [V2]

 

Whats the formula, im confuzzled

$acc= $ir['totalhits'] / ($ir['totalhits']+$ir['totalmisses']) *100

 

i got an error off:

Parse error: syntax error, unexpected '}' in /home/darkstr1/public_html/index.php on line 8

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