Code: Show/Hide /** Starts a timed event. * @param func the TimerFunc to call * @param initialdelay how long to wait from now until the first * call (in ticks) * @param interval how long to wait between calls (in ticks) * @param param a closure argument that will get passed to the timer * function * @param key a key that can be used to selectively cancel timers */ void (*SetTimer)(TimerFunc func, int initialdelay, int interval, void *param, void *key); /** timer functions must be of this type. * @param param is a closure argument * @return true if the timer wants to continue running, false if it * wants to be cancelled */ typedef int (*TimerFunc)(void *param); |
Code: Show/Hide #include "clientset.h" |
Code: Show/Hide local Iclientset *cs;
local override_key_t ok_DoorMode; |
Code: Show/Hide ok_DoorMode = cs->GetOverrideKey("door", "doormode"); |
Code: Show/Hide local void closeDoors(Arena *a)
{ Player *p; Link *link; cs->ArenaOverride(a, ok_DoorMode, 255); pd->Lock(); FOR_EACH_PLAYER(p) { if(p->arena == a) cs->SendClientSettings(p); } pd->Unlock(); } local void openDoors(Arena *a) { Player *p; Link *link; cs->ArenaUnoverride(a, ok_DoorMode); pd->Lock(); FOR_EACH_PLAYER(p) { if(p->arena == a) cs->SendClientSettings(p); } pd->Unlock(); } |