mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 17:58:16 +08:00
[bot] Implement n_SendChat(...)
* Implement `CNetGame::SendChat(...)`
This commit is contained in:
1 parent
5d75008e6d
commit
db20065e56
3 files changed
+18
-2
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
+5
-2
@@ -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[])
|
||||
|
||||
Reference in new issue
Block a user