diff --git a/server/gangzonepool.h b/server/gangzonepool.h index d8be82b..5ae4814 100644 --- a/server/gangzonepool.h +++ b/server/gangzonepool.h @@ -22,6 +22,11 @@ public: void FlashForAll(WORD wZone, DWORD dwColor); void StopFlashForPlayer(PLAYERID playerId, WORD wZone); void StopFlashForAll(WORD wZone); + BOOL GetSlotState(WORD wZone) + { + if (wZone >= MAX_GANG_ZONES) return FALSE; + return m_bSlotState[wZone]; + }; }; //---------------------------------------------------- diff --git a/server/netgame.h b/server/netgame.h index 40ba930..9b2ac11 100644 --- a/server/netgame.h +++ b/server/netgame.h @@ -85,6 +85,7 @@ public: RakServerInterface * GetRakServer() { return m_pRak; }; CGameMode * GetGameMode() { return m_pGameMode; }; CFilterScripts * GetFilterScripts() { return m_pFilterScripts; }; + CGangZonePool * GetGangZonePool() { return m_pGangZonePool; }; CActorPool * GetActorPool() { return m_pActorPool; }; void MasterServerAnnounce(float fElapsedTime); diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index a2ce642..b8a6544 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -590,10 +590,13 @@ static cell AMX_NATIVE_CALL n_GangZoneCreate(AMX *amx, cell *params) return 0; } +// native GangZoneDestroy(zone) static cell AMX_NATIVE_CALL n_GangZoneDestroy(AMX *amx, cell *params) { - // TODO: GangZoneDestroy - return 0; + CGangZonePool *pGangZonePool = pNetGame->GetGangZonePool(); + if (!pGangZonePool || !pGangZonePool->GetSlotState(params[1])) return 0; + pGangZonePool->Delete(params[1]); + return 1; } static cell AMX_NATIVE_CALL n_GangZoneShowForPlayer(AMX *amx, cell *params)