SA-MP/server/scrtimers.h

45 lines
1014 B
C
Raw Normal View History

2023-10-29 22:26:43 +08:00
#ifndef SAMPSRV_TIMERS_H
#define SAMPSRV_TIMERS_H
struct ScriptTimer_s
{
char szScriptFunc[255];
int iTotalTime;
int iRemainingTime;
BOOL bRepeating;
BOOL bKilled;
AMX* pAMX;
int iParamCount;
void* cellParams;
};
typedef std::map<DWORD, ScriptTimer_s*> DwordTimerMap;
//----------------------------------------------------------------------------------
class CScriptTimers
2023-10-29 22:26:43 +08:00
{
private:
DwordTimerMap m_Timers;
DWORD m_dwTimerCount;
public:
CScriptTimers();
2024-01-06 23:33:14 +08:00
~CScriptTimers();
void DeleteForMode(AMX* pEndedAMX);
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
DWORD NewEx(char* szScriptFunc, int iInterval, BOOL bRepeating, cell *params, AMX* pAMX);
void Delete(DWORD dwTimerId);
void Kill(DWORD dwTimerId);
void Process(int iElapsedTime);
void FreeMem(ScriptTimer_s* Timer);
2023-10-29 22:26:43 +08:00
};
//----------------------------------------------------------------------------------
2023-10-29 22:26:43 +08:00
#endif
//----------------------------------------------------------------------------------
// EOF