mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +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)
|
||||
static cell AMX_NATIVE_CALL n_KillTimer(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_KillTimer
|
||||
return 0;
|
||||
pNetGame->GetTimers()->Kill(params[1]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
||||
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
|
||||
void Kill(DWORD dwTimerId);
|
||||
void FreeMem(ScriptTimer_s* Timer);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user