Quote:
Originally Posted by Crow
PHP Code:
this.a = { 1, 2, 3, 4, 5 };
this.aElement = 0;
this.output = this.a[this.aElement];
function NextElement() {
this.aElement = (this.aElement + 1) % this.a.size();
this.output = this.a[this.aElement];
}
|
How would you do that with serverr.var being the actual day set though? I think I know, but I'm going to play dumb so I can learn and not screw anything up. It needs to be a serverr.var for the day, so all people have it read, as this may change again later for dev Armageddon reasons. :P
Quote:
Originally Posted by DrakilorP2P
One-liner and without extra variables:
PHP Code:
serverr.day = this.dayarray[(this.dayarray.index(serverr.day) + 1) % this.dayarray.size()];
Assumes that serverr.day is a valid value.
|
so if onCreated i declare it array[0] and use that will it be ok?