working to me.
[for those who is going to add this extension]
1. Write This In Main Code:
Code: Select all
CTaskMngr TaskManager;
extern DLL_FUNCTIONS *g_pFunctionTable;
static float TimeLimit;
static float TimeLeft = 0.0f;3. After Creating Forward, Add there this code:
Code: Select all
g_pFunctionTable->pfnSpawn = OnSpawn;
g_pFunctionTable->pfnStartFrame = OnStartFrame;Code: Select all
int OnSpawn(edict_t *P1)
{
TimeLimit = CVAR_GET_FLOAT("mp_timelimit");
TaskManager.registerTimers(&gpGlobals->time, &TimeLimit, &TimeLeft);
g_pFunctionTable->pfnSpawn = NULL;
return NULL;
}
void OnStartFrame(void)
{
TaskManager.startFrame();
}Flag:
1 = Repeat Task With Specified Times.
2 = Loop Infinitely.
