diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index 8f1ae79..047b0a6 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -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)