mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
5467762720
* Implement `CScriptTimers::Delete(...)` * Update `CNetGame::Process()`
45 lines
1014 B
C++
45 lines
1014 B
C++
|
|
#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
|
|
{
|
|
private:
|
|
DwordTimerMap m_Timers;
|
|
DWORD m_dwTimerCount;
|
|
public:
|
|
CScriptTimers();
|
|
~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);
|
|
};
|
|
|
|
//----------------------------------------------------------------------------------
|
|
|
|
#endif
|
|
|
|
//----------------------------------------------------------------------------------
|
|
// EOF
|