mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-04 00:23:22 +08:00
[server] Implement/match n_KillTimer(...)
* Implement/match `CScriptTimers::Kill(...)`
This commit is contained in:
parent
875dc0ed5c
commit
5675f1555b
@ -83,8 +83,9 @@ static cell AMX_NATIVE_CALL n_SetTimer(AMX *amx, cell *params)
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL n_KillTimer(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_KillTimer(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
// TODO: KillTimer
|
pNetGame->GetTimers()->Kill(params[1]);
|
||||||
return 0;
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@ -139,3 +139,17 @@ DWORD CScriptTimers::NewEx(char* szScriptFunc, int iInterval, BOOL bRepeating, c
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void CScriptTimers::Kill(DWORD dwTimerId)
|
||||||
|
{
|
||||||
|
DwordTimerMap::iterator itor;
|
||||||
|
itor = m_Timers.find(dwTimerId);
|
||||||
|
if (itor != m_Timers.end())
|
||||||
|
{
|
||||||
|
itor->second->iRemainingTime = 0;
|
||||||
|
itor->second->bKilled = true;
|
||||||
|
itor->second->bRepeating = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ public:
|
|||||||
|
|
||||||
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
|
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
|
||||||
DWORD NewEx(char* szScriptFunc, int iInterval, BOOL bRepeating, cell *params, AMX* pAMX);
|
DWORD NewEx(char* szScriptFunc, int iInterval, BOOL bRepeating, cell *params, AMX* pAMX);
|
||||||
|
void Kill(DWORD dwTimerId);
|
||||||
void FreeMem(ScriptTimer_s* Timer);
|
void FreeMem(ScriptTimer_s* Timer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user