- Joined
- Dec 2, 2016
- Messages
- 733
I want to do something like this
array myArray = {"Player1Name","Player2Name","Player3Name"}
for i = 1,#myArray do
if player(0) == myArray[1] then
//blah
end
end
I'm new to jass so this is written in Lua but you get the idea, how would I go about this?
Edit: I got what I need working by creating a array variable, and assigning each index to a player name and then looping through each index and checking if the index = player name and executing the code. Is this the best way to go about this?
Also how can I check array length? Indexes.
array myArray = {"Player1Name","Player2Name","Player3Name"}
for i = 1,#myArray do
if player(0) == myArray[1] then
//blah
end
end
I'm new to jass so this is written in Lua but you get the idea, how would I go about this?
Edit: I got what I need working by creating a array variable, and assigning each index to a player name and then looping through each index and checking if the index = player name and executing the code. Is this the best way to go about this?
Also how can I check array length? Indexes.
Last edited: