mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement n_SendChat(...)
* Implement `CNetGame::SendChat(...)`
This commit is contained in:
parent
5d75008e6d
commit
db20065e56
@ -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()
|
||||
{
|
||||
field_1DE = 0;
|
||||
|
@ -98,6 +98,8 @@ public:
|
||||
void ResetPlayerPool();
|
||||
void ShutdownForGameModeRestart();
|
||||
|
||||
void SendChat(char *szText);
|
||||
|
||||
BOOL IsPlayerAdded(PLAYERID playerId);
|
||||
void SetMyZAngle(float fAngle);
|
||||
|
||||
|
@ -115,8 +115,11 @@ static cell AMX_NATIVE_CALL n_ResumeRecordingPlayback(AMX *amx, cell *params)
|
||||
// native SendChat(msg[])
|
||||
static cell AMX_NATIVE_CALL n_SendChat(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_SendChat
|
||||
return 0;
|
||||
char* szMessage;
|
||||
amx_StrParam(amx, params[1], szMessage);
|
||||
if(pNetGame)
|
||||
pNetGame->SendChat(szMessage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// native SendCommand(commandtext[])
|
||||
|
Loading…
Reference in New Issue
Block a user