mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement/match n_GetPlayerVehicleID(...)
* Implement/match `CNetGame::GetPlayerVehicleID(...)`
This commit is contained in:
parent
3930e321c9
commit
c264951e74
@ -100,6 +100,25 @@ BOOL CNetGame::GetPlayerPos(PLAYERID playerId, PVECTOR Vector)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VEHICLEID CNetGame::GetPlayerVehicleID(PLAYERID playerId)
|
||||
{
|
||||
if(playerId >= MAX_PLAYERS) return INVALID_VEHICLE_ID;
|
||||
if(bPlayerSlotState[playerId] == FALSE) return INVALID_VEHICLE_ID;
|
||||
|
||||
if(bytePlayerState[playerId] == PLAYER_STATE_DRIVER)
|
||||
{
|
||||
return unnamed_4[playerId].VehicleID;
|
||||
}
|
||||
else if(bytePlayerState[playerId] == PLAYER_STATE_PASSENGER)
|
||||
{
|
||||
return unnamed_5[playerId].VehicleID;
|
||||
}
|
||||
else
|
||||
{
|
||||
return INVALID_VEHICLE_ID;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
// MATCH
|
||||
BOOL CNetGame::IsPlayerAdded(PLAYERID playerId)
|
||||
|
@ -109,6 +109,7 @@ public:
|
||||
void SetPlayerState(PLAYERID playerId, BYTE byteState);
|
||||
BYTE GetPlayerState(PLAYERID playerId);
|
||||
BOOL GetPlayerPos(PLAYERID playerId, PVECTOR Vector);
|
||||
VEHICLEID GetPlayerVehicleID(PLAYERID playerId);
|
||||
void StopRecordingPlayback();
|
||||
void PauseRecordingPlayback();
|
||||
void ResumeRecordingPlayback();
|
||||
|
@ -166,7 +166,10 @@ static cell AMX_NATIVE_CALL n_GetPlayerPos(AMX *amx, cell *params)
|
||||
// native GetPlayerVehicleID(playerid)
|
||||
static cell AMX_NATIVE_CALL n_GetPlayerVehicleID(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_GetPlayerVehicleID
|
||||
if(pNetGame->GetPlayerPool()->GetSlotState((PLAYERID)params[1]))
|
||||
{
|
||||
return pNetGame->GetPlayerVehicleID((PLAYERID)params[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user