mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 12:16:15 +08:00
[bot] Implement n_SendChat(...)
* Implement `CNetGame::SendChat(...)`
This commit is contained in:
@ -578,6 +578,17 @@ void CNetGame::SetVehicleAdded(VEHICLEID VehicleID, BOOL a2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNetGame::SendChat(char *szText)
|
||||||
|
{
|
||||||
|
BYTE byteTextLen = strlen(szText);
|
||||||
|
|
||||||
|
RakNet::BitStream bsSend;
|
||||||
|
bsSend.Write(byteTextLen);
|
||||||
|
bsSend.Write(szText,byteTextLen);
|
||||||
|
|
||||||
|
GetRakClient()->RPC(RPC_Chat,&bsSend,HIGH_PRIORITY,RELIABLE,0,false);
|
||||||
|
}
|
||||||
|
|
||||||
void CNetGame::StopRecordingPlayback()
|
void CNetGame::StopRecordingPlayback()
|
||||||
{
|
{
|
||||||
field_1DE = 0;
|
field_1DE = 0;
|
||||||
|
@ -98,6 +98,8 @@ public:
|
|||||||
void ResetPlayerPool();
|
void ResetPlayerPool();
|
||||||
void ShutdownForGameModeRestart();
|
void ShutdownForGameModeRestart();
|
||||||
|
|
||||||
|
void SendChat(char *szText);
|
||||||
|
|
||||||
BOOL IsPlayerAdded(PLAYERID playerId);
|
BOOL IsPlayerAdded(PLAYERID playerId);
|
||||||
void SetMyZAngle(float fAngle);
|
void SetMyZAngle(float fAngle);
|
||||||
|
|
||||||
|
@ -115,8 +115,11 @@ static cell AMX_NATIVE_CALL n_ResumeRecordingPlayback(AMX *amx, cell *params)
|
|||||||
// native SendChat(msg[])
|
// native SendChat(msg[])
|
||||||
static cell AMX_NATIVE_CALL n_SendChat(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_SendChat(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
// TODO: n_SendChat
|
char* szMessage;
|
||||||
return 0;
|
amx_StrParam(amx, params[1], szMessage);
|
||||||
|
if(pNetGame)
|
||||||
|
pNetGame->SendChat(szMessage);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// native SendCommand(commandtext[])
|
// native SendCommand(commandtext[])
|
||||||
|
Reference in New Issue
Block a user