diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index 3ba34fd..1c86e03 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -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; diff --git a/bot/net/netgame.h b/bot/net/netgame.h index e352b96..c9d1da6 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -98,6 +98,8 @@ public: void ResetPlayerPool(); void ShutdownForGameModeRestart(); + void SendChat(char *szText); + BOOL IsPlayerAdded(PLAYERID playerId); void SetMyZAngle(float fAngle); diff --git a/bot/scrcustom.cpp b/bot/scrcustom.cpp index b4d7eb2..d57a5a3 100644 --- a/bot/scrcustom.cpp +++ b/bot/scrcustom.cpp @@ -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[])