mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[server] Implement/match n_SetSpawnInfo(...)
This commit is contained in:
parent
0b15ccfb87
commit
50997f9f03
@ -5,7 +5,13 @@
|
||||
#pragma pack(1)
|
||||
typedef struct _PLAYER_SPAWN_INFO
|
||||
{
|
||||
char _pad0[46];
|
||||
BYTE byteTeam;
|
||||
int iSkin;
|
||||
BYTE field_5;
|
||||
VECTOR vecPos;
|
||||
float fRotation;
|
||||
int iSpawnWeapons[3];
|
||||
int iSpawnWeaponsAmmo[3];
|
||||
} PLAYER_SPAWN_INFO;
|
||||
|
||||
//----------------------------------------------------
|
||||
@ -16,7 +22,11 @@ class CPlayer
|
||||
public:
|
||||
|
||||
// Size: 11486
|
||||
char _pad0[11261];
|
||||
char _pad0[10509];
|
||||
|
||||
BOOL field_290D;
|
||||
|
||||
char _pad2911[748];
|
||||
|
||||
PLAYER_SPAWN_INFO m_SpawnInfo;
|
||||
BOOL m_bHasSpawnInfo;
|
||||
|
@ -826,9 +826,36 @@ static cell AMX_NATIVE_CALL n_NetStats_GetIpPort(AMX *amx, cell *params)
|
||||
|
||||
static cell AMX_NATIVE_CALL n_SetSpawnInfo(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: SetSpawnInfo
|
||||
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
|
||||
if(!pPlayerPool) return 0;
|
||||
|
||||
CPlayer *pPlayer = pPlayerPool->GetAt((PLAYERID)params[1]);
|
||||
if (pPlayer)
|
||||
{
|
||||
PLAYER_SPAWN_INFO SpawnInfo;
|
||||
SpawnInfo.byteTeam = (BYTE)params[2];
|
||||
SpawnInfo.iSkin = (int)params[3];
|
||||
SpawnInfo.vecPos.X = amx_ctof(params[4]);
|
||||
SpawnInfo.vecPos.Y = amx_ctof(params[5]);
|
||||
SpawnInfo.vecPos.Z = amx_ctof(params[6]);
|
||||
SpawnInfo.fRotation = amx_ctof(params[7]);
|
||||
SpawnInfo.iSpawnWeapons[0] = (int)params[8];
|
||||
SpawnInfo.iSpawnWeaponsAmmo[0] = (int)params[9];
|
||||
SpawnInfo.iSpawnWeapons[1] = (int)params[10];
|
||||
SpawnInfo.iSpawnWeaponsAmmo[1] = (int)params[11];
|
||||
SpawnInfo.iSpawnWeapons[2] = (int)params[12];
|
||||
SpawnInfo.iSpawnWeaponsAmmo[2] = (int)params[13];
|
||||
|
||||
pPlayer->SetSpawnInfo(&SpawnInfo);
|
||||
pPlayer->field_290D = TRUE;
|
||||
RakNet::BitStream bsData;
|
||||
bsData.Write((PCHAR)&SpawnInfo, sizeof(PLAYER_SPAWN_INFO));
|
||||
pNetGame->SendToPlayer(RPC_ScrSetSpawnInfo, &bsData, (PLAYERID)params[1], 2);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL n_SpawnPlayer(AMX *amx, cell *params)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user