Unless a function was added to handle it, I've been using a timeout loop. I.e:
PHP Code:
function onCreated() {
// Clear array of detected RCs
this.lastRCs = "";
// Start Loop
onTimeout();
}
function onTimeout() {
// Declare an Empty Array for RCs
temp.rcs = {};
// Loop through All Players currently online
for (temp.a: allplayers) {
// Check if they're in a level
// No level usually means they're an RC
if (temp.a.level == NULL) {
// Player's level was NULL
// Player is actually an RC
// Add Player to Array of RCs
temp.rcs.add(temp.a);
}
}
// Check if the amount of RCs is greater than the last amount of RCs online.
if (temp.rcs.size() > this.lastRCs.size()) {
// RCs have logged on.
sendtorc("Staff Reminder! You're all special C:");
}
// Record the new array of RCs for the next timeout
this.lastRCs = temp.rcs;
// Continue Looping
setTimer(0.5);
}
That's just a way I've doing it though.
Also instead of maintaining a 'this.staff' array you can just directly reference your server options.
temp.staff = serveroptions.staff.tokenize(",");
The tokenize(",") is just in case someone messes up the array formatting.