There is also another global var added to this race which has its own section under all the other decelerations:
This is for dealing with timers which require tracking to prevent errors or to ensure they get killed on demand. This is part of the timer handling system that does not exist in any of the races that I have not coded. The other parts of the system are explained below:Code://TIMERS new Handle:SpawnTimer[MAXPLAYERS+1];
In the above section of the Crypt Lord we see that firstly the method order follows a logical process to make it easy to read and reference. We can also see that there is a lot of automated handling to ensure that timers are tracked and destroyed correctly when needed. This is very important to prevent crashes. This is also all the code needed to ensure that a timer which must end when the round stops or the client spawns, dies ect does so without creating errors.Code:public OnPluginStart() { //Safe way to stop timers at end of round HookEvent("round_end",RoundEnd); } public OnMapStart() { OnMapStart_UltBlockSound(); War3_PrecacheSound(ultimateSound); //Reset Arrays Array_Fill(SpawnTimer, MAXPLAYERS+1, INVALID_HANDLE); } public RoundEnd(Handle:event,const String:name[],bool:dontBroadcast) { //CLEAR TIMERS LoopClearTimers(); } public OnClientDisconnect(client) { ClearTimers(client); } //CLEAR TIMERS ClearTimers(client) { CleanTimerCell(SpawnTimer, client); }







Register To Reply