2023-10-31 21:31:16 +08:00
|
|
|
|
2024-01-30 21:52:00 +08:00
|
|
|
#ifndef SAMPNPC_TIMERS_H
|
|
|
|
#define SAMPNPC_TIMERS_H
|
|
|
|
|
|
|
|
struct ScriptTimer_s
|
|
|
|
{
|
2024-08-29 23:14:15 +08:00
|
|
|
char szScriptFunc[255];
|
|
|
|
int iTotalTime;
|
|
|
|
int iRemainingTime;
|
|
|
|
BOOL bRepeating;
|
|
|
|
BOOL bKilled;
|
|
|
|
AMX* pAMX;
|
|
|
|
int iParamCount;
|
2024-03-14 23:24:26 +08:00
|
|
|
void* cellParams;
|
2024-01-30 21:52:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<DWORD, ScriptTimer_s*> DwordTimerMap;
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class CScriptTimers
|
2023-10-31 21:31:16 +08:00
|
|
|
{
|
|
|
|
private:
|
2024-01-30 21:52:00 +08:00
|
|
|
DwordTimerMap m_Timers;
|
|
|
|
DWORD m_dwTimerCount;
|
2023-10-31 21:31:16 +08:00
|
|
|
public:
|
|
|
|
CScriptTimers();
|
2024-03-14 23:24:26 +08:00
|
|
|
~CScriptTimers();
|
2024-01-30 21:52:00 +08:00
|
|
|
|
2024-08-29 23:22:54 +08:00
|
|
|
void DeleteForMode(AMX* pEndedAMX);
|
2024-08-29 23:14:15 +08:00
|
|
|
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
|
2024-08-29 23:24:28 +08:00
|
|
|
void Delete(DWORD dwTimerId);
|
2024-08-29 23:15:47 +08:00
|
|
|
void Kill(DWORD dwTimerId);
|
2024-03-14 23:24:26 +08:00
|
|
|
void FreeMem(ScriptTimer_s* Timer);
|
2024-01-30 21:52:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|