mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement RequestSpawn(...)
This commit is contained in:
parent
843b2406bf
commit
c82d3764fd
@ -42,6 +42,8 @@ BYTE unnamed_8[MAX_PLAYERS];
|
||||
BOOL unnamed_7[MAX_VEHICLES];
|
||||
char unnamed_4[1000][63];
|
||||
|
||||
bool bSpawned = false;
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
// TODO: length assert has to be at line 397
|
||||
|
@ -7,6 +7,8 @@ extern CNetGame* pNetGame;
|
||||
#define REJECT_REASON_BAD_NICKNAME 2
|
||||
#define REJECT_REASON_BAD_MOD 3
|
||||
|
||||
extern bool bSpawned;
|
||||
|
||||
void EnterVehicle(RPCParameters *rpcParams) {}
|
||||
void ExitVehicle(RPCParameters *rpcParams) {}
|
||||
void Unk6B(RPCParameters *rpcParams) {}
|
||||
@ -200,7 +202,21 @@ void RequestClass(RPCParameters *rpcParams)
|
||||
|
||||
void RequestSpawn(RPCParameters *rpcParams)
|
||||
{
|
||||
// TODO: RequestSpawn
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
PlayerID sender = rpcParams->sender;
|
||||
|
||||
BYTE byteRequestOutcome=0;
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
bsData.Read(byteRequestOutcome);
|
||||
|
||||
if(byteRequestOutcome) {
|
||||
// Let the rest of the network know we're spawning.
|
||||
if(pNetGame->GetBotMode()) pNetGame->GetBotMode()->OnNPCSpawn();
|
||||
bSpawned = true;
|
||||
RakNet::BitStream bsSendSpawn;
|
||||
pNetGame->GetRakClient()->RPC(RPC_Spawn,&bsSendSpawn,HIGH_PRIORITY,RELIABLE_SEQUENCED,0,false);
|
||||
}
|
||||
}
|
||||
|
||||
void Unk20(RPCParameters *rpcParams)
|
||||
|
Loading…
Reference in New Issue
Block a user