menu
I want to see the percent of all players on the server but it doesnt work
exemple this line shows me how many percent i got and it works great Code:
Terroist Surviver </td><td> %i / %i </td><td> %d%% </td></tr>", iAchLevel[i][SURVIVE], iAchPoints[SURVIVE], 100 * iAchLevel[i][SURVIVE] / iAchPoints[SURVIVE]);when i open the meny it shows that i got 0% and evry body else got random percent LOL Code:
new szMenuKey[128];Code:
new szMenuKey[128];and here is the array Code:
new iAchLevel[MaxPlayers][iAchCount]Code:
iAchLevel[id][JUMP]++ |
Re: menu
new percent = 100 * iAchLevel[i][i]/iAchPoints[i]
to new percent = 100 * iAchLevel[iPlayer][ACHIEVMENT NUMBER!!!!]/iAchPoints[ACHIEVMENT NUMBER!!!] but this is incorrect. if you want to show HOW MANY achievments have player of all possible achievments you should 100 * allplayerachievments / totalpossibleachievmentscount. as i know for you it is: GlobalVariable: iTotalAchievements = totalpossibleachievmentscount all player achievments = TotalAchievements[Player_id] if you want to show players achievment of selected ACHIEVMENT: for example achievment: "SURVIVE" player1 done: [0 %] player2 done: [50 %] this is: 100* iAchLevel[player id][achievement id]/iAchPoints[achievment id] |
Re: menu
this code worked perfect for me :)
Code:
new percent = 100 * iAchLevel[iPlayer][i]/iAchPoints[i]so if the total points is 100 and you got 50 points it say [50%] Done :) |
Re: menu
new percent = 100 * iAchLevel[iPlayer][i]/iAchPoints[i]
with this you will get incorrect result cause "i" it is loop variable for players so in result you will see: first player name first achievment [player]/ first achievment total second player name second achievment [player / second achievment total ... .. i mean your achievment increaseas too. so if you want to display total you should use this: new precent = 100*TotalAchievements[iPlayer]/iTotalAchievements |
Re: menu
Quote:
Code:
new percent = 100 * iAchLevel[iPlayer]/iAchPoints[i]Code:
Error: Array must be indexed (variable "iAchLevel") on line 404 |
Re: menu
do what I said and don't do with "some other method".
for total: new precent = 100*TotalAchievements[iPlayer]/iTotalAchievements for "defined" achievement: PHP Code:
|
Re: menu
[QUOTE=AngeIII;1870856]do what I said and don't do with "some other method".
for total: new precent = 100*TotalAchievements[iPlayer]/iTotalAchievements for "defined" achievement: PHP Code:
like this iAchLevel is how many kills/death/survivor/jumps you got and iAchpoints is the total points you can get but when i do that i get error Code:
new percent = 100 * iAchLevel[iPlayer]/iAchPoints[i] |
Re: menu
so you need to summup firstly.
... PHP Code:
|
Re: menu
Nope i solved it
its works perfect with this code Code:
new percent = 100 * iAchLevel[iPlayer][i]/iAchPoints[i] |
Re: menu
it is definetly wrong... variable i it is loop variable which can be from 1 to 32.
your achievments iAchPoints and iAchLevel doesn't indexed to [][33]. my method correct but I think you dont understand so good luck. when you will get errors reread : https://forums.alliedmods.net/showpo...61&postcount=2 https://forums.alliedmods.net/showpo...56&postcount=6 https://forums.alliedmods.net/showpo...94&postcount=8 |
| All times are GMT -4. The time now is 13:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.