mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[bot] Implement/match n_KillTimer(...)
* Implement/match `CScriptTimers::Kill(...)`
This commit is contained in:
parent
323f51a166
commit
02b4a7b509
@ -45,8 +45,9 @@ static cell AMX_NATIVE_CALL n_SetTimer(AMX *amx, cell *params)
|
|||||||
// native KillTimer(timerid)
|
// native KillTimer(timerid)
|
||||||
static cell AMX_NATIVE_CALL n_KillTimer(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_KillTimer(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
// TODO: n_KillTimer
|
pNetGame->GetTimers()->Kill(params[1]);
|
||||||
return 0;
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// native GetTickCount()
|
// native GetTickCount()
|
||||||
|
@ -55,3 +55,17 @@ DWORD CScriptTimers::New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ public:
|
|||||||
~CScriptTimers();
|
~CScriptTimers();
|
||||||
|
|
||||||
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
|
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, 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