Skip to content

Commit

Permalink
Init stuff for pathfinding, breaking changes for GoTo functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggi committed Dec 6, 2018
1 parent 5b2f835 commit 8a0ecc0
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 43 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a fork of the [original repository](https://github.com/OrMisicL/FCNPC) b

If you encounter a bug or a crash, create an issue in the [issues section](../../issues) with your **crashlog** and your **Pawn script**.

For more elaborate discussions see the [forum thread](http://forum.sa-mp.com/showthread.php?t=428066), or the [Russian forum thread](http://forum.sa-mp.com/showthread.php?t=602965).
For more elaborate discussions see the [forum thread](http://forum.sa-mp.com/showthread.php?t=428066) *(isn't working now, but we hope)*, or the [Russian forum thread](http://forum.sa-mp.com/showthread.php?t=602965).

See the [wiki](../../wiki) for documentation.

Expand Down Expand Up @@ -82,6 +82,12 @@ Constants
#define FCNPC_MOVE_MODE_AUTO (-1)
#define FCNPC_MOVE_MODE_NONE (0)
#define FCNPC_MOVE_MODE_MAPANDREAS (1)
#define FCNPC_MOVE_MODE_COLANDREAS (2)
#define FCNPC_MOVE_PATHFINDING_AUTO (-1)
#define FCNPC_MOVE_PATHFINDING_NONE (0)
#define FCNPC_MOVE_PATHFINDING_Z (1)
#define FCNPC_MOVE_PATHFINDING_RAYCAST (2)
#define FCNPC_MOVE_SPEED_AUTO (-1.0)
#define FCNPC_MOVE_SPEED_WALK (0.1552086)
Expand Down Expand Up @@ -143,6 +149,8 @@ native FCNPC_SetTickRate(rate);
native FCNPC_GetTickRate();
native FCNPC_UseMoveMode(mode, bool:use = true);
native bool:FCNPC_IsMoveModeUsed(mode);
native FCNPC_UseMovePathfinding(pathfinding, bool:use = true);
native bool:FCNPC_IsMovePathfindingUsed(pathfinding);
native FCNPC_UseCrashLog(bool:use = true);
native bool:FCNPC_IsCrashLogUsed();
Expand Down Expand Up @@ -245,8 +253,8 @@ native bool:FCNPC_IsReloadingUsed(npcid);
native FCNPC_UseInfiniteAmmo(npcid, bool:use = true);
native bool:FCNPC_IsInfiniteAmmoUsed(npcid);
native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_Stop(npcid);
native bool:FCNPC_IsMoving(npcid);
native bool:FCNPC_IsMovingAtPlayer(npcid, playerid);
Expand Down Expand Up @@ -331,7 +339,7 @@ native FCNPC_RemovePointFromMovePath(pathid, pointid);
native bool:FCNPC_IsValidMovePathPoint(pathid, pointid);
native FCNPC_GetMovePathPoint(pathid, pointid, &Float:x, &Float:y, &Float:z);
native FCNPC_GetNumberMovePathPoint(pathid);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);
native FCNPC_SetMoveMode(npcid, mode);
native FCNPC_GetMoveMode(npcid);
Expand All @@ -346,4 +354,9 @@ native FCNPC_HideInTabListForPlayer(npcid, forplayerid);
For some reasons FCNPC includes some another plugins. You don't need to use this plugins separately.

## MapAndreas
http://forum.sa-mp.com/showthread.php?t=275492

MapAndreas 1.2.1 included.

## ColAndreas

Latest ColAndreas version included.
13 changes: 10 additions & 3 deletions sampsvr_files/FCNPC.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public FCNPC_IncludeVersion = FCNPC_INCLUDE_VERSION;
#define FCNPC_MOVE_MODE_MAPANDREAS (1)
#define FCNPC_MOVE_MODE_COLANDREAS (2)

#define FCNPC_MOVE_PATHFINDING_AUTO (-1)
#define FCNPC_MOVE_PATHFINDING_NONE (0)
#define FCNPC_MOVE_PATHFINDING_Z (1)
#define FCNPC_MOVE_PATHFINDING_RAYCAST (2)

#define FCNPC_MOVE_SPEED_AUTO (-1.0)
#define FCNPC_MOVE_SPEED_WALK (0.1552086)
#define FCNPC_MOVE_SPEED_RUN (0.56444)
Expand Down Expand Up @@ -99,6 +104,8 @@ native FCNPC_SetTickRate(rate);
native FCNPC_GetTickRate();
native FCNPC_UseMoveMode(mode, bool:use = true);
native bool:FCNPC_IsMoveModeUsed(mode);
native FCNPC_UseMovePathfinding(pathfinding, bool:use = true);
native bool:FCNPC_IsMovePathfindingUsed(pathfinding);
native FCNPC_UseCrashLog(bool:use = true);
native bool:FCNPC_IsCrashLogUsed();

Expand Down Expand Up @@ -201,8 +208,8 @@ native bool:FCNPC_IsReloadingUsed(npcid);
native FCNPC_UseInfiniteAmmo(npcid, bool:use = true);
native bool:FCNPC_IsInfiniteAmmoUsed(npcid);

native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_Stop(npcid);
native bool:FCNPC_IsMoving(npcid);
native bool:FCNPC_IsMovingAtPlayer(npcid, playerid);
Expand Down Expand Up @@ -293,7 +300,7 @@ native FCNPC_RemovePointFromMovePath(pathid, pointid);
native bool:FCNPC_IsValidMovePathPoint(pathid, pointid);
native FCNPC_GetMovePathPoint(pathid, pointid, &Float:x, &Float:y, &Float:z);
native FCNPC_GetNumberMovePathPoint(pathid);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);

native FCNPC_SetMoveMode(npcid, mode);
native FCNPC_GetMoveMode(npcid);
Expand Down
45 changes: 37 additions & 8 deletions src/CPlayerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CPlayerData::CPlayerData(WORD playerId, char *szName)
m_iMovePoint = 0;
m_iMoveType = MOVE_TYPE_AUTO;
m_iMoveMode = MOVE_MODE_AUTO;
m_iMovePathfinding = MOVE_PATHFINDING_AUTO;
m_fMoveRadius = 0.0f;
m_bMoveSetAngle = false;
m_fMoveSpeed = MOVE_SPEED_AUTO;
Expand Down Expand Up @@ -1605,7 +1606,7 @@ void CPlayerData::GetKeys(WORD *pwUDAnalog, WORD *pwLRAnalog, DWORD *pdwKeys)
*pdwKeys = m_pPlayer->dwKeys;
}

bool CPlayerData::GoTo(const CVector &vecPoint, int iType, int iMode, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset, DWORD dwStopDelay)
bool CPlayerData::GoTo(const CVector &vecPoint, int iType, int iMode, int iPathfinding, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset, DWORD dwStopDelay)
{
// Validate the movement
if (iType == MOVE_TYPE_AUTO && GetState() == PLAYER_STATE_DRIVER) {
Expand Down Expand Up @@ -1676,15 +1677,16 @@ bool CPlayerData::GoTo(const CVector &vecPoint, int iType, int iMode, float fRad
m_bMoving = true;
// Save the data
SetMoveMode(iMode);
SetMovePathfinding(iPathfinding);
m_iMoveType = iType;
m_dwMoveStopDelay = dwStopDelay;
return true;
}

bool CPlayerData::GoToPlayer(WORD wPlayerId, int iType, int iMode, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset, float fDistCheck, DWORD dwStopDelay)
bool CPlayerData::GoToPlayer(WORD wPlayerId, int iType, int iMode, int iPathfinding, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset, float fDistCheck, DWORD dwStopDelay)
{
CVector vecPos = pNetGame->pPlayerPool->pPlayer[wPlayerId]->vecPosition;
if (GoTo(vecPos, iType, iMode, fRadius, bSetAngle, fSpeed, fDistOffset)) {
if (GoTo(vecPos, iType, iMode, iPathfinding, fRadius, bSetAngle, fSpeed, fDistOffset)) {
m_wMoveId = wPlayerId;
m_vecMovePlayerPosition = vecPos;
m_fDistCheck = fDistCheck;
Expand All @@ -1694,10 +1696,10 @@ bool CPlayerData::GoToPlayer(WORD wPlayerId, int iType, int iMode, float fRadius
return false;
}

bool CPlayerData::GoByMovePath(int iPathId, int iPointId, int iType, int iMode, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset)
bool CPlayerData::GoByMovePath(int iPathId, int iPointId, int iType, int iMode, int iPathfinding, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset)
{
CVector *vecPos = pServer->GetMovePath()->GetPoint(iPathId, 0);
if (GoTo(*vecPos, iType, iMode, fRadius, bSetAngle, fSpeed, fDistOffset)) {
if (GoTo(*vecPos, iType, iMode, iPathfinding, fRadius, bSetAngle, fSpeed, fDistOffset)) {
m_iMovePath = iPathId;
m_iMovePoint = iPointId;
return true;
Expand Down Expand Up @@ -1774,6 +1776,7 @@ void CPlayerData::StopMoving()
m_iMovePath = INVALID_MOVEPATH_ID;
m_iMovePoint = 0;
m_iMoveMode = MOVE_MODE_AUTO;
m_iMovePathfinding = MOVE_PATHFINDING_AUTO;
// Reset the player data
SetVelocity(CVector(0.0f, 0.0f, 0.0f));
SetTrainSpeed(0.0f);
Expand Down Expand Up @@ -2146,7 +2149,7 @@ bool CPlayerData::EnterVehicle(WORD wVehicleId, BYTE byteSeatId, int iType)
CFunctions::PlayerEnterVehicle(m_pPlayer, m_wVehicleToEnter, m_byteSeatToEnter);
} else {
// Go to the vehicle
GoTo(vecDestination, iType, GetMoveMode());
GoTo(vecDestination, iType, GetMoveMode(), GetMovePathfinding());
}

return true;
Expand Down Expand Up @@ -2518,7 +2521,7 @@ bool CPlayerData::PlayNode(int iNodeId, int iMoveType, int iMode, float fRadius,
UpdateNodePoint(m_wNodePoint);

m_pNode->GetPosition(&vecPos);
GoTo(vecPos, iMoveType, iMode, fRadius, bSetAngle, fSpeed);
GoTo(vecPos, iMoveType, iMode, MOVE_PATHFINDING_NONE, fRadius, bSetAngle, fSpeed);
return true;
}

Expand Down Expand Up @@ -2569,7 +2572,7 @@ void CPlayerData::ResumePlayingNode()
}

m_bIsPlayingNodePaused = false;
GoTo(m_vecNodeLastPos, m_iNodeMoveType, m_iNodeMoveMode, m_fNodeMoveRadius, m_bNodeMoveSetAngle, m_fNodeMoveSpeed);
GoTo(m_vecNodeLastPos, m_iNodeMoveType, m_iNodeMoveMode, MOVE_PATHFINDING_NONE, m_fNodeMoveRadius, m_bNodeMoveSetAngle, m_fNodeMoveSpeed);
}

bool CPlayerData::IsPlayingNodePaused()
Expand Down Expand Up @@ -2641,6 +2644,32 @@ int CPlayerData::GetMoveMode()
return m_iMoveMode;
}

bool CPlayerData::SetMovePathfinding(int iMovePathfinding)
{
if (iMovePathfinding == MOVE_PATHFINDING_AUTO) {
if (pServer->IsMovePathfindingEnabled(MOVE_PATHFINDING_RAYCAST)) {
m_iMovePathfinding = MOVE_PATHFINDING_RAYCAST;
} else if (pServer->IsMovePathfindingEnabled(MOVE_PATHFINDING_Z)) {
m_iMovePathfinding = MOVE_PATHFINDING_Z;
} else {
m_iMovePathfinding = MOVE_PATHFINDING_NONE;
}
} else {
if (!pServer->IsMovePathfindingEnabled(iMovePathfinding)) {
m_iMovePathfinding = MOVE_PATHFINDING_NONE;
return false;
}

m_iMovePathfinding = iMovePathfinding;
}
return true;
}

int CPlayerData::GetMovePathfinding()
{
return m_iMovePathfinding;
}

void CPlayerData::SetMinHeightPosCall(float fHeight)
{
m_fMinHeightPos = fHeight;
Expand Down
9 changes: 6 additions & 3 deletions src/CPlayerData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class CPlayerData
void ApplyAnimation(char *szAnimationLib, char *szAnimationName, float fDelta, bool bLoop, bool bLockX, bool bLockY, bool bFreeze, int iTime);
void ClearAnimations();

bool GoTo(const CVector &vecPoint, int iType, int iMode, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f, DWORD dwStopDelay = 250);
bool GoToPlayer(WORD wPlayerId, int iType, int iMode, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f, float fDistCheck = 1.5f, DWORD dwStopDelay = 250);
bool GoByMovePath(int iPathId, int iPointId, int iType, int iMode, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f);
bool GoTo(const CVector &vecPoint, int iType, int iMode, int iPathfinding, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f, DWORD dwStopDelay = 250);
bool GoToPlayer(WORD wPlayerId, int iType, int iMode, int iPathfinding, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f, float fDistCheck = 1.5f, DWORD dwStopDelay = 250);
bool GoByMovePath(int iPathId, int iPointId, int iType, int iMode, int iPathfinding, float fRadius = 0.0f, bool bSetAngle = true, float fSpeed = -1.0f, float fDistOffset = 0.0f);
void UpdateMovingData(CVector vecDestination, float fRadius, bool bSetAngle, float fSpeed, float fDistOffset);
void GetDestination(CVector *pvecDestination);
void StopMoving();
Expand Down Expand Up @@ -214,6 +214,8 @@ class CPlayerData

bool SetMoveMode(int iMoveMode);
int GetMoveMode();
bool SetMovePathfinding(int iMovePathfinding);
int GetMovePathfinding();
void SetMinHeightPosCall(float fHeight);
float GetMinHeightPosCall();

Expand Down Expand Up @@ -284,6 +286,7 @@ class CPlayerData
int m_iMovePoint;
int m_iMoveType;
int m_iMoveMode;
int m_iMovePathfinding;
float m_fMoveRadius;
bool m_bMoveSetAngle;
float m_fMoveSpeed;
Expand Down
15 changes: 15 additions & 0 deletions src/CServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ CServer::CServer(eSAMPVersion version)
for (int i = MOVE_MODE_NONE + 1; i < MOVE_MODE_SIZE; i++) {
m_bMoveModeEnabled[i] = true;
}
// init pathfinding mode
for (int i = MOVE_PATHFINDING_NONE + 1; i < MOVE_PATHFINDING_SIZE; i++) {
m_bMovePathfindingEnabled[i] = true;
}
// Initialize random seed
srand(static_cast<unsigned int>(time(NULL)));
}
Expand All @@ -46,6 +50,7 @@ CServer::~CServer()
SAFE_DELETE(m_pMovePath);
SAFE_DELETE(m_pRecordManager);
SAFE_DELETE(m_pMapAndreas);
SAFE_DELETE(m_pColAndreas);
}

BYTE CServer::Initialize(AMX *pAMX)
Expand Down Expand Up @@ -258,6 +263,16 @@ bool CServer::IsMoveModeEnabled(int iMoveMode)
return m_bMoveModeEnabled[iMoveMode];
}

void CServer::ToggleMovePathfinding(int iMovePathfinding, bool bIsEnabled)
{
m_bMovePathfindingEnabled[iMovePathfinding] = bIsEnabled;
}

bool CServer::IsMovePathfindingEnabled(int iMovePathfinding)
{
return m_bMovePathfindingEnabled[iMovePathfinding];
}

bool CServer::IsVehicleSeatOccupied(WORD wPlayerId, WORD wVehicleId, BYTE byteSeatId)
{
WORD wSeatPlayerId = GetVehicleSeatPlayerId(wVehicleId, byteSeatId);
Expand Down
3 changes: 3 additions & 0 deletions src/CServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class CServer

void ToggleMoveMode(int iMoveMode, bool bIsEnabled);
bool IsMoveModeEnabled(int iMoveMode);
void ToggleMovePathfinding(int iMovePathfinding, bool bIsEnabled);
bool IsMovePathfindingEnabled(int iMovePathfinding);

bool IsVehicleSeatOccupied(WORD wPlayerId, WORD wVehicleId, BYTE byteSeatId);
WORD GetVehicleSeatPlayerId(WORD wVehicleId, BYTE byteSeatId);
Expand All @@ -73,6 +75,7 @@ class CServer
DWORD m_dwUpdateRate;
bool m_bCrashLogCreation;
bool m_bMoveModeEnabled[MOVE_MODE_SIZE];
bool m_bMovePathfindingEnabled[MOVE_PATHFINDING_SIZE];

int m_iTicks;
int m_iTickRate;
Expand Down
8 changes: 8 additions & 0 deletions src/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ enum MOVE_MODE {
MOVE_MODE_COLANDREAS,
MOVE_MODE_SIZE,
};
// Pathfinding mode
enum MOVE_PATHFINDING {
MOVE_PATHFINDING_AUTO = -1,
MOVE_PATHFINDING_NONE = 0,
MOVE_PATHFINDING_Z,
MOVE_PATHFINDING_RAYCAST,
MOVE_PATHFINDING_SIZE,
};
// Moving velocity
#define MOVE_SPEED_AUTO -1.0f
#define MOVE_SPEED_WALK 0.1552086f
Expand Down
13 changes: 10 additions & 3 deletions src/FCNPC.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public FCNPC_IncludeVersion = FCNPC_INCLUDE_VERSION;
#define FCNPC_MOVE_MODE_MAPANDREAS (1)
#define FCNPC_MOVE_MODE_COLANDREAS (2)

#define FCNPC_MOVE_PATHFINDING_AUTO (-1)
#define FCNPC_MOVE_PATHFINDING_NONE (0)
#define FCNPC_MOVE_PATHFINDING_Z (1)
#define FCNPC_MOVE_PATHFINDING_RAYCAST (2)

#define FCNPC_MOVE_SPEED_AUTO (-1.0)
#define FCNPC_MOVE_SPEED_WALK (0.1552086)
#define FCNPC_MOVE_SPEED_RUN (0.56444)
Expand Down Expand Up @@ -99,6 +104,8 @@ native FCNPC_SetTickRate(rate);
native FCNPC_GetTickRate();
native FCNPC_UseMoveMode(mode, bool:use = true);
native bool:FCNPC_IsMoveModeUsed(mode);
native FCNPC_UseMovePathfinding(pathfinding, bool:use = true);
native bool:FCNPC_IsMovePathfindingUsed(pathfinding);
native FCNPC_UseCrashLog(bool:use = true);
native bool:FCNPC_IsCrashLogUsed();

Expand Down Expand Up @@ -201,8 +208,8 @@ native bool:FCNPC_IsReloadingUsed(npcid);
native FCNPC_UseInfiniteAmmo(npcid, bool:use = true);
native bool:FCNPC_IsInfiniteAmmoUsed(npcid);

native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, stopdelay = 250);
native FCNPC_GoToPlayer(npcid, playerid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0, Float:dist_check = 1.5, stopdelay = 250);
native FCNPC_Stop(npcid);
native bool:FCNPC_IsMoving(npcid);
native bool:FCNPC_IsMovingAtPlayer(npcid, playerid);
Expand Down Expand Up @@ -293,7 +300,7 @@ native FCNPC_RemovePointFromMovePath(pathid, pointid);
native bool:FCNPC_IsValidMovePathPoint(pathid, pointid);
native FCNPC_GetMovePathPoint(pathid, pointid, &Float:x, &Float:y, &Float:z);
native FCNPC_GetNumberMovePathPoint(pathid);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);
native FCNPC_GoByMovePath(npcid, pathid, pointid = 0, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, pathfinding = FCNPC_MOVE_PATHFINDING_AUTO, Float:radius = 0.0, bool:set_angle = true, Float:min_distance = 0.0);

native FCNPC_SetMoveMode(npcid, mode);
native FCNPC_GetMoveMode(npcid);
Expand Down
2 changes: 2 additions & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ AMX_NATIVE_INFO PluginNatives[] = {
{ "FCNPC_GetTickRate", CNatives::FCNPC_GetTickRate },
{ "FCNPC_UseMoveMode", CNatives::FCNPC_UseMoveMode },
{ "FCNPC_IsMoveModeUsed", CNatives::FCNPC_IsMoveModeUsed },
{ "FCNPC_UseMovePathfinding", CNatives::FCNPC_UseMovePathfinding },
{ "FCNPC_IsMovePathfindingUsed", CNatives::FCNPC_IsMovePathfindingUsed },
{ "FCNPC_TriggerWeaponShot", CNatives::FCNPC_TriggerWeaponShot },
{ "FCNPC_UseCrashLog", CNatives::FCNPC_UseCrashLog },
{ "FCNPC_IsCrashLogUsed", CNatives::FCNPC_IsCrashLogUsed },
Expand Down
Loading

0 comments on commit 8a0ecc0

Please sign in to comment.