mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[server] Implement/match n_GetPlayerSurfingVehicleID(...)
This commit is contained in:
parent
d60dc61013
commit
c972dd0ade
@ -28,7 +28,12 @@ typedef struct _PLAYER_SPAWN_INFO
|
||||
#pragma pack(1)
|
||||
typedef struct _ONFOOT_SYNC_DATA
|
||||
{
|
||||
char _pad0[68];
|
||||
char _pad0[62];
|
||||
|
||||
WORD wSurfInfo;
|
||||
|
||||
char _pad40[4];
|
||||
|
||||
// TODO: _ONFOOT_SYNC_DATA
|
||||
} ONFOOT_SYNC_DATA;
|
||||
|
||||
@ -210,6 +215,7 @@ public:
|
||||
|
||||
int field_2CDA;
|
||||
|
||||
ONFOOT_SYNC_DATA* GetOnFootSyncData() { return &m_ofSync; }
|
||||
|
||||
BYTE GetState() { return m_byteState; };
|
||||
|
||||
|
@ -955,8 +955,17 @@ static cell AMX_NATIVE_CALL n_GetPlayerVehicleSeat(AMX *amx, cell *params)
|
||||
|
||||
static cell AMX_NATIVE_CALL n_GetPlayerSurfingVehicleID(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: GetPlayerSurfingVehicleID
|
||||
return 0;
|
||||
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
|
||||
if(!pPlayerPool) return 0xFFFF;
|
||||
|
||||
CPlayer *pPlayer = pPlayerPool->GetAt((PLAYERID)params[1]);
|
||||
if(pPlayer && pPlayer->GetState() == PLAYER_STATE_ONFOOT) {
|
||||
WORD wSurfInfo = pPlayer->GetOnFootSyncData()->wSurfInfo;
|
||||
if(wSurfInfo != 0 && wSurfInfo < 2000) {
|
||||
return wSurfInfo;
|
||||
}
|
||||
}
|
||||
return 0xFFFF;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL n_GetPlayerSurfingObjectID(AMX *amx, cell *params)
|
||||
|
Loading…
Reference in New Issue
Block a user