mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 12:16:15 +08:00
[bot] Implement n_SendCommand(...)
* Implement `CNetGame::SendCommand(...)`
This commit is contained in:
@ -589,6 +589,16 @@ void CNetGame::SendChat(char *szText)
|
|||||||
GetRakClient()->RPC(RPC_Chat,&bsSend,HIGH_PRIORITY,RELIABLE,0,false);
|
GetRakClient()->RPC(RPC_Chat,&bsSend,HIGH_PRIORITY,RELIABLE,0,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNetGame::SendCommand(char *szCommand)
|
||||||
|
{
|
||||||
|
RakNet::BitStream bsParams;
|
||||||
|
int iStrlen = strlen(szCommand);
|
||||||
|
|
||||||
|
bsParams.Write(iStrlen);
|
||||||
|
bsParams.Write(szCommand, iStrlen);
|
||||||
|
GetRakClient()->RPC(RPC_ServerCommand,&bsParams,HIGH_PRIORITY,RELIABLE,0,false);
|
||||||
|
}
|
||||||
|
|
||||||
void CNetGame::StopRecordingPlayback()
|
void CNetGame::StopRecordingPlayback()
|
||||||
{
|
{
|
||||||
field_1DE = 0;
|
field_1DE = 0;
|
||||||
|
@ -99,6 +99,7 @@ public:
|
|||||||
void ShutdownForGameModeRestart();
|
void ShutdownForGameModeRestart();
|
||||||
|
|
||||||
void SendChat(char *szText);
|
void SendChat(char *szText);
|
||||||
|
void SendCommand(char *szCommand);
|
||||||
|
|
||||||
BOOL IsPlayerAdded(PLAYERID playerId);
|
BOOL IsPlayerAdded(PLAYERID playerId);
|
||||||
void SetMyZAngle(float fAngle);
|
void SetMyZAngle(float fAngle);
|
||||||
|
@ -125,8 +125,11 @@ static cell AMX_NATIVE_CALL n_SendChat(AMX *amx, cell *params)
|
|||||||
// native SendCommand(commandtext[])
|
// native SendCommand(commandtext[])
|
||||||
static cell AMX_NATIVE_CALL n_SendCommand(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_SendCommand(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
// TODO: n_SendCommand
|
char* szCommand;
|
||||||
return 0;
|
amx_StrParam(amx, params[1], szCommand);
|
||||||
|
if(pNetGame)
|
||||||
|
pNetGame->SendCommand(szCommand);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// native GetPlayerState(playerid)
|
// native GetPlayerState(playerid)
|
||||||
|
Reference in New Issue
Block a user