Zytraw Posted April 17, 2009 Posted April 17, 2009 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 Quote
(((TOLK))) Posted April 18, 2009 Posted April 18, 2009 Re: [V2] New Small Accuracy Mod [V2] nice idea mate Quote
ryzzo123 Posted April 18, 2009 Posted April 18, 2009 Re: [V2] New Small Accuracy Mod [V2] yeah good idea and does this work ????? Quote
MyGunWars Posted April 18, 2009 Posted April 18, 2009 Re: [V2] New Small Accuracy Mod [V2] Nice Something To Add To The Attack Statistics Quote
POG1 Posted April 19, 2009 Posted April 19, 2009 Re: [V2] New Small Accuracy Mod [V2] You could add an accuracy bar. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
MyGunWars Posted April 19, 2009 Posted April 19, 2009 Re: [V2] New Small Accuracy Mod [V2] accuracy bar sounds cool Quote
Zytraw Posted April 21, 2009 Author Posted April 21, 2009 Re: [V2] New Small Accuracy Mod [V2] Yeh worked fine for me and thanks POG1. Quote
mentaljason Posted April 21, 2009 Posted April 21, 2009 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. Quote
tobatz Posted April 23, 2009 Posted April 23, 2009 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 Quote
POG1 Posted April 25, 2009 Posted April 25, 2009 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. 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 :) Quote
Guest Sniko` Posted April 25, 2009 Posted April 25, 2009 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. 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 Quote
Danny696 Posted April 26, 2009 Posted April 26, 2009 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. Quote
Karlos Posted April 26, 2009 Posted April 26, 2009 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 Quote
Danny696 Posted April 26, 2009 Posted April 26, 2009 Re: [V2] New Small Accuracy Mod [V2] it woked thanks: Your Accuracy 330.769230769 thats good Quote
tobatz Posted April 27, 2009 Posted April 27, 2009 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. 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 Quote
POG1 Posted April 27, 2009 Posted April 27, 2009 Re: [V2] New Small Accuracy Mod [V2] The second value on the fraction should of been total attacks (hits & misses) Quote
Zytraw Posted April 28, 2009 Author Posted April 28, 2009 Re: [V2] New Small Accuracy Mod [V2] So have i got the correct formula? Or.... Thanks :P Quote
Guest Sniko` Posted April 30, 2009 Posted April 30, 2009 Re: [V2] New Small Accuracy Mod [V2] Whats the formula, im confuzzled Quote
Danny696 Posted April 30, 2009 Posted April 30, 2009 Re: [V2] New Small Accuracy Mod [V2] the accuracy bar dont work and he 2nd formula dont work Quote
mmomaker Posted April 30, 2009 Posted April 30, 2009 Re: [V2] New Small Accuracy Mod [V2] wats this mod for Quote
tobatz Posted May 1, 2009 Posted May 1, 2009 Re: [V2] New Small Accuracy Mod [V2] Whats the formula, im confuzzled $acc= $ir['totalhits'] / ($ir['totalhits']+$ir['totalmisses']) *100 Quote
Zytraw Posted May 1, 2009 Author Posted May 1, 2009 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 Quote
Danny696 Posted May 1, 2009 Posted May 1, 2009 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 Quote
Faz` Posted May 1, 2009 Posted May 1, 2009 Re: [V2] New Small Accuracy Mod [V2] Post up line 8. Quote
Danny696 Posted May 1, 2009 Posted May 1, 2009 Re: [V2] New Small Accuracy Mod [V2] heres the whole index.php: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.