View Single Post
  #6  
Old 07-26-2010, 11:28 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by Crow View Post
PHP Code:
this.= { 1234};
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 View Post
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?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote