It would be great if there was a way to get all index out of a multi-dimensional array. I don't really know how to word this ...
For example,
PHP Code:
temp.staff = {
{"cbk1994", "Scripter"},
{"PepperTheCat", "Management"}
};
temp.staffIndex = staff.getIndexes[0].index(@ player.account);
if (staffIndex > -1) {
temp.position = staff[staffIndex[1]];
player.chat = "You are staff:" SPC position;
}
Instead, something like this has to be used:
PHP Code:
temp.staff = {
{"cbk1994", "Scripter"},
{"PepperTheCat", "Management"}
};
temp.staffIndex = null;
for (temp.member : staff) {
if (member[0] == player.account) {
staffIndex = staff.index(@ member);
}
}
if (staffIndex > -1) {
temp.position = staff[staffIndex[1]];
player.chat = "You are staff:" SPC position;
}
I thought there was a way to do this, but Skyld didn't know of one, and neither did any of the other people I asked.