[server] Implement/match n_GetPlayerVehicleSeat(...)

This commit is contained in:
RD42 2024-09-20 23:47:34 +08:00
parent 9ac72cc0f7
commit 5242eac4ac
2 changed files with 11 additions and 3 deletions

View File

@ -182,7 +182,7 @@ public:
BOOL m_bHasSpawnInfo; BOOL m_bHasSpawnInfo;
char field_2C2F; char field_2C2F;
char field_2C30; char field_2C30;
char field_2C31; BYTE m_byteSeatID;
VEHICLEID m_VehicleID; VEHICLEID m_VehicleID;
DWORD m_dwColor; DWORD m_dwColor;
BOOL m_bCheckpointEnabled; BOOL m_bCheckpointEnabled;

View File

@ -946,10 +946,18 @@ static cell AMX_NATIVE_CALL n_GetPlayerVehicleID(AMX *amx, cell *params)
return 0; return 0;
} }
// native GetPlayerVehicleSeat(playerid)
static cell AMX_NATIVE_CALL n_GetPlayerVehicleSeat(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_GetPlayerVehicleSeat(AMX *amx, cell *params)
{ {
// TODO: GetPlayerVehicleSeat CPlayer *pPlayer = pNetGame->GetPlayerPool()->GetAt((PLAYERID)params[1]);
return 0; if (!pPlayer) return -1;
if (pPlayer->GetState() == PLAYER_STATE_DRIVER ||
pPlayer->GetState() == PLAYER_STATE_PASSENGER)
return pPlayer->m_byteSeatID;
// Vehicle not found or the player isn't in it;
return -1;
} }
static cell AMX_NATIVE_CALL n_GetPlayerSurfingVehicleID(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_GetPlayerSurfingVehicleID(AMX *amx, cell *params)