mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-20 04:36:01 +08:00
[saco] Implement CNetGame map icon functions
Implements: * `CNetGame::SetMapIcon(...)` * `CNetGame::DisableMapIcon(...)` * `CNetGame::ResetMapIcons()`
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include "../main.h"
|
#include "../main.h"
|
||||||
|
|
||||||
|
extern CGame *pGame;
|
||||||
extern CChatWindow *pChatWindow;
|
extern CChatWindow *pChatWindow;
|
||||||
|
|
||||||
CNetGame::CNetGame(PCHAR szHostOrIp, int iPort,
|
CNetGame::CNetGame(PCHAR szHostOrIp, int iPort,
|
||||||
@ -50,3 +51,37 @@ DWORD CNetGame::GetTime()
|
|||||||
{
|
{
|
||||||
return (DWORD)RakNet::GetTime();
|
return (DWORD)RakNet::GetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Puts a personal marker using any of the radar icons on the map
|
||||||
|
|
||||||
|
void CNetGame::SetMapIcon(BYTE byteIndex, float fX, float fY, float fZ, BYTE byteIcon, DWORD dwColor, int iStyle)
|
||||||
|
{
|
||||||
|
if (byteIndex >= 100) return;
|
||||||
|
if (m_dwMapIcon[byteIndex] != NULL) DisableMapIcon(byteIndex);
|
||||||
|
//ScriptCommand(&create_radar_marker_without_sphere, fX, fY, fZ, byteIcon, &m_dwMapIcon);
|
||||||
|
m_dwMapIcon[byteIndex] = pGame->CreateRadarMarkerIcon(byteIcon, fX, fY, fZ, dwColor, iStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Removes the Map Icon
|
||||||
|
|
||||||
|
void CNetGame::DisableMapIcon(BYTE byteIndex)
|
||||||
|
{
|
||||||
|
if (byteIndex >= 100) return;
|
||||||
|
ScriptCommand(&disable_marker, m_dwMapIcon[byteIndex]);
|
||||||
|
m_dwMapIcon[byteIndex] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
|
void CNetGame::ResetMapIcons()
|
||||||
|
{
|
||||||
|
BYTE i;
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
if (m_dwMapIcon[i] != NULL) DisableMapIcon(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
@ -51,7 +51,7 @@ private:
|
|||||||
char field_234;
|
char field_234;
|
||||||
int m_iPort;
|
int m_iPort;
|
||||||
int field_239;
|
int field_239;
|
||||||
char field_23D[400];
|
DWORD m_dwMapIcon[100];
|
||||||
int m_iGameState;
|
int m_iGameState;
|
||||||
int field_3D1;
|
int field_3D1;
|
||||||
struc_41 *field_3D5;
|
struc_41 *field_3D5;
|
||||||
@ -69,4 +69,7 @@ public:
|
|||||||
|
|
||||||
CPlayerPool * GetPlayerPool() { return m_pPools->pPlayerPool; };
|
CPlayerPool * GetPlayerPool() { return m_pPools->pPlayerPool; };
|
||||||
|
|
||||||
|
void ResetMapIcons();
|
||||||
|
void SetMapIcon(BYTE byteIndex, float fX, float fY, float fZ, BYTE byteIcon, DWORD dwColor, int iStyle);
|
||||||
|
void DisableMapIcon(BYTE byteIndex);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user