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