mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement/match n_SetMyPos(...)
* Implement/match `CNetGame::SetMyPos(...)`
This commit is contained in:
parent
831b304f20
commit
8a4b1ed7a0
@ -237,6 +237,24 @@ BOOL CNetGame::IsVehicleAdded(VEHICLEID VehicleID)
|
||||
return bVehicleSlotState[VehicleID] != FALSE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//----------------------------------------------------
|
||||
void CNetGame::SetMyPos(PVECTOR Vector)
|
||||
{
|
||||
if(byteState == PLAYER_STATE_ONFOOT)
|
||||
{
|
||||
ofSync.vecPos.X = Vector->X;
|
||||
ofSync.vecPos.Y = Vector->Y;
|
||||
ofSync.vecPos.Z = Vector->Z;
|
||||
}
|
||||
else if (byteState == PLAYER_STATE_DRIVER)
|
||||
{
|
||||
icSync.vecPos.X = Vector->X;
|
||||
icSync.vecPos.Y = Vector->Y;
|
||||
icSync.vecPos.Z = Vector->Z;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
float CNetGame::GetMyZAngle()
|
||||
{
|
||||
|
@ -115,6 +115,7 @@ public:
|
||||
BYTE GetPlayerArmour(PLAYERID playerId);
|
||||
BOOL GetPlayerKeys(PLAYERID playerId, WORD *udAnalog, WORD *lrAnalog, WORD *wKeys);
|
||||
BOOL IsVehicleAdded(VEHICLEID VehicleID);
|
||||
void SetMyPos(PVECTOR Vector);
|
||||
float GetMyZAngle();
|
||||
|
||||
void StopRecordingPlayback();
|
||||
|
@ -259,8 +259,13 @@ static cell AMX_NATIVE_CALL n_GetMyPos(AMX *amx, cell *params)
|
||||
// native SetMyPos(Float:x, Float:y, Float:z)
|
||||
static cell AMX_NATIVE_CALL n_SetMyPos(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: n_SetMyPos
|
||||
return 0;
|
||||
if(!pNetGame->GetPlayerPool()) return 0;
|
||||
VECTOR vecPos;
|
||||
vecPos.X = amx_ctof(params[1]);
|
||||
vecPos.Y = amx_ctof(params[2]);
|
||||
vecPos.Z = amx_ctof(params[3]);
|
||||
pNetGame->SetMyPos(&vecPos);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// native GetMyFacingAngle(&Float:ang)
|
||||
|
Loading…
Reference in New Issue
Block a user