That's a pseudo. It'll cost roughly 5 times the cpu than just putting it in mod heartbeat, where code like this really belongs. I would also avoid calling up campaign ints so many times, by loading the campaign ints into local ints oncliententer.
To do this from mod hearbeat, just use modulo, on an incrementing counter. It'd look something like this:
void main() {
object oMod = GetModule();
int nUptime = GetLocalInt(oMod, "uptime");
if (!(nUptime%360)) {
//do stuff here (loop pcs and give xp based on their variables)
}
nUptime += 6;//mod heartbeat runs about every 6 seconds
SetLocalInt(oMod, "uptime", nUptime);
}
Funky