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

This commit is contained in:
RD42 2024-09-18 23:42:13 +08:00
parent c972dd0ade
commit cace251a9d

View File

@ -970,8 +970,17 @@ static cell AMX_NATIVE_CALL n_GetPlayerSurfingVehicleID(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL n_GetPlayerSurfingObjectID(AMX *amx, cell *params)
{
// TODO: GetPlayerSurfingObjectID
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 && wSurfInfo < 3000) {
return wSurfInfo - 2000;
}
}
return 0xFFFF;
}
static cell AMX_NATIVE_CALL n_PutPlayerInVehicle(AMX *amx, cell *params)