Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
hello i was wondering if anyone knows any easy way to see which players scores come in what order. i have 6 players and one pc tht needs to be considered. i want it to show on my multiboard 1st 2nd 3rd and so on. every way i think of is a little long and i was wondering if anyone knows a good way to find them out. note these r custom scores tht players get by doing stuff in my map. thx for anyones help
tht should work good thx i need a slightly different one for another thing tho i have player 0,1,2,3,4,5 but i also have player 11. what would be the best way to do this ?
Well you can set the end to 10. You did mean to to say P11 score is in [10], right?
Then it will loop through the array from 0 to 10 and sort the numbers. If players always gets at least one point then you can just pick the first seven numbers and ignore the rest as they will be 0.
no p11 is in 11 sry i list players as if there jass ex p0 is in 0 etc
also heres a problem. i need these values to stay in the index they start which means i need it to set them to a temp variable but i need to know which place goes to which player
ex:
scores[0] = 10 //is player 0
scores[1] = 1 //is player 1
scores[2] = 15 //is player 2
scores[3] = 25 //is player 3
scores[4] = 32 //is player 4
scores[5] = 9 //is player 5
when run through the function u provided it changes it to this
scores[0] = 32 //is player 0
scores[1] = 25 //is player 1
scores[2] = 15 //is player 2
scores[3] = 10 //is player 3
scores[4] = 9 //is player 4
scores[5] = 1 //is player 5
so if i went to set them to my multiboard in the column i use playerid + 1 to show values
it would always show player 0 as being 1st and so on unless im not getting something ? also thx for all ur help w this
edit: i got it to work the way i wanted if u could take a look to see if i could improve the loop actions the rest of it will be changed for my uses
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
local integer start = 0
local integer end = 8
local integer curr = 2
local integer temp
local integer array pInt
local integer array i
local integer L = 0
local string array b
local string array bf
set bf[0] = "1st"
set bf[1] = "2nd"
set bf[2] = "3rd"
set bf[3] = "4th"
set bf[4] = "5th"
set bf[5] = "6th"
set bf[6] = "7th"
set bf[7] = "8th"
set bf[8] = "9th"
set pInt[0] = 10
set pInt[1] = 1
set pInt[2] = 15
set pInt[3] = 25
set pInt[4] = 32
set pInt[5] = 9
loop
exitwhen start > end
set i[start] = pInt[start]
set start = start + 1
endloop
set start = 0
loop
if i[start] < i[curr] then
set temp = i[start]
set i[start] = i[curr]
set i[curr] = temp
endif
exitwhen start == end - 1
if curr == end then
set curr = start + 2
set start = start + 1
else
set curr = curr + 1
endif
endloop
set start = 0
loop
exitwhen start > end
set L = 0
loop
exitwhen L > end
if pInt[start] == i[L] then
set b[start] = bf[L]
endif
set L = L + 1
endloop
set start = start + 1
endloop
endfunction
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.