Skip to content

FCNPC 2.0.0 RC1 (Without Pathfinding Feature)

Pre-release
Pre-release
Compare
Choose a tag to compare
@ziggi ziggi released this 06 Dec 22:03
· 100 commits to master since this release

Main changes

  • Insane optimization
  • Great bug fixing
  • Unbelievable cleanup
  • Many new functions
  • Now FCNPC includes latest versions of ColAndreas and MapAndreas, so you don't needed to add these plugins anymore
  • Full SA-MP 0.3-DL support

Breaking changes

Some callbacks and functions was reworked:

FCNPC 1.8.2 FCNPC 2.0.0
forward FCNPC_OnDeath(npcid, killerid, weaponid); forward FCNPC_OnDeath(npcid, killerid, reason);
forward FCNPC_OnVehicleEntryComplete(npcid, vehicleid, seat); forward FCNPC_OnVehicleEntryComplete(npcid, vehicleid, seatid);
forward FCNPC_OnVehicleExitComplete(npcid); forward FCNPC_OnVehicleExitComplete(npcid, vehicleid);
forward FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss); forward FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart);
forward FCNPC_OnGiveDamage(npcid, damagedid, weaponid, bodypart, Float:health_loss); forward FCNPC_OnGiveDamage(npcid, damagedid, Float:amount, weaponid, bodypart);
forward FCNPC_OnVehicleTakeDamage(npcid, damagerid, vehicleid, weaponid, Float:x, Float:y, Float:z); forward FCNPC_OnVehicleTakeDamage(npcid, issuerid, vehicleid, Float:amount, weaponid, Float:fX, Float:fY, Float:fZ);
forward FCNPC_OnWeaponShot(npcid, weaponid, hittype, hitid, Float:x, Float:y, Float:z); forward FCNPC_OnWeaponShot(npcid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
forward FCNPC_OnFinishNodePoint(npcid, point); forward FCNPC_OnFinishNode(npcid, nodeid);
forward FCNPC_OnChangeNode(npcid, nodeid); forward FCNPC_OnChangeNode(npcid, newnodeid, oldnodeid);
forward FCNPC_OnFinishNode(npcid); forward FCNPC_OnFinishNodePoint(npcid, nodeid, pointid);
forward FCNPC_OnChangeHeightPos(npcid, Float:new_z, Float:old_z); forward FCNPC_OnChangeHeightPos(npcid, Float:newz, Float:oldz);
native FCNPC_Create(name[]); native FCNPC_Create(const name[]);
native FCNPC_ToggleCrashLogCreation(bool:toggle); native FCNPC_UseCrashLog(bool:use = true);
native FCNPC_GetCrashLogCreation(); native bool:FCNPC_IsCrashLogUsed();
native FCNPC_IsSpawned(npcid); native bool:FCNPC_IsSpawned(npcid);
native FCNPC_IsDead(npcid); native bool:FCNPC_IsDead(npcid);
native FCNPC_IsValid(npcid); native bool:FCNPC_IsValid(npcid);
native FCNPC_IsStreamedIn(npcid, forplayerid); native bool:FCNPC_IsStreamedIn(npcid, forplayerid);
native FCNPC_IsStreamedForAnyone(npcid); native bool:FCNPC_IsStreamedInForAnyone(npcid);
native FCNPC_IsInvulnerable(npcid); native bool:FCNPC_IsInvulnerable(npcid);
native FCNPC_SetAnimationByName(npcid, name[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1); native FCNPC_SetAnimationByName(npcid, const name[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1);
native FCNPC_ApplyAnimation(npcid, animlib[], animname[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1); native FCNPC_ApplyAnimation(npcid, const animlib[], const animname[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1);
native FCNPC_ToggleReloading(npcid, bool:toggle); native FCNPC_UseReloading(npcid, bool:use = true);
native FCNPC_ToggleInfiniteAmmo(npcid, bool:toggle); native FCNPC_UseInfiniteAmmo(npcid, bool:use = true);
native FCNPC_GoTo(npcid, Float:x, Float:y, Float:z, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, bool:UseMapAndreas = false, Float:radius = 0.0, bool:setangle = true, Float:dist_offset = 0.0, 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, bool:UseMapAndreas = false, Float:radius = 0.0, bool:setangle = true, Float:dist_offset = 0.0, Float:dist_check = 1.5, 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_IsMoving(npcid); native bool:FCNPC_IsMoving(npcid);
native FCNPC_IsMovingAtPlayer(npcid, playerid); native bool:FCNPC_IsMovingAtPlayer(npcid, playerid);
native FCNPC_AimAt(npcid, Float:x, Float:y, Float:z, bool:shoot = false, shoot_delay = -1, bool:setangle = true, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0); native FCNPC_AimAt(npcid, Float:x, Float:y, Float:z, bool:shoot = false, shoot_delay = -1, bool:set_angle = true, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0, between_check_flags = FCNPC_ENTITY_CHECK_ALL);
native FCNPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shoot_delay = -1, bool:setangle = true, Float:offset_x = 0.0, Float:offset_y = 0.0, Float:offset_z = 0.0, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0); native FCNPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shoot_delay = -1, bool:set_angle = true, Float:offset_x = 0.0, Float:offset_y = 0.0, Float:offset_z = 0.0, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0, between_check_flags = FCNPC_ENTITY_CHECK_ALL);
native FCNPC_IsAttacking(npcid); native bool:FCNPC_IsAttacking(npcid);
native FCNPC_IsAiming(npcid); native bool:FCNPC_IsAiming(npcid);
native FCNPC_IsAimingAtPlayer(npcid, playerid); native bool:FCNPC_IsAimingAtPlayer(npcid, playerid);
native FCNPC_IsShooting(npcid); native bool:FCNPC_IsShooting(npcid);
native FCNPC_IsReloading(npcid); native bool:FCNPC_IsReloading(npcid);
native FCNPC_TriggerWeaponShot(npcid, weaponid, hittype, hitid, Float:x, Float:y, Float:z, bool:ishit = true, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0); native FCNPC_TriggerWeaponShot(npcid, weaponid, hittype, hitid, Float:x, Float:y, Float:z, bool:is_hit = true, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0, between_check_flags = FCNPC_ENTITY_CHECK_ALL);
native FCNPC_SetVehicleSiren(npcid, bool:status); native FCNPC_UseVehicleSiren(npcid, bool:use = true);
native FCNPC_IsVehicleSiren(npcid); native bool:FCNPC_IsVehicleSirenUsed(npcid);
native FCNPC_StartPlayingPlayback(npcid, file[] = "", recordid = FCNPC_INVALID_RECORD_ID, bool:auto_unload = false); native FCNPC_StartPlayingPlayback(npcid, const file[] = "", recordid = FCNPC_INVALID_RECORD_ID, bool:auto_unload = false, Float:delta_x = 0.0, Float:delta_y = 0.0, Float:delta_z = 0.0, Float:delta_qw = 0.0, Float:delta_qx = 0.0, Float:delta_qy = 0.0, Float:delta_qz = 0.0);
native FCNPC_LoadPlayingPlayback(file[]); native FCNPC_LoadPlayingPlayback(const file[]);
native FCNPC_SetPlayingPlaybackPath(npcid, path[]); native FCNPC_SetPlayingPlaybackPath(npcid, const path[]);
native FCNPC_IsNodeOpen(nodeid); native bool:FCNPC_IsNodeOpen(nodeid);
native FCNPC_SetNodePoint(nodeid, point); native FCNPC_SetNodePoint(nodeid, pointid);
native FCNPC_PlayNode(npcid, nodeid, move_type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, bool:UseMapAndreas = false, Float:radius = 0.0, bool:setangle = true); native FCNPC_PlayNode(npcid, nodeid, move_type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, mode = FCNPC_MOVE_MODE_AUTO, Float:radius = 0.0, bool:set_angle = true);
native FCNPC_IsPlayingNode(npcid); native bool:FCNPC_IsPlayingNode(npcid);
native FCNPC_IsPlayingNodePaused(npcid); native bool:FCNPC_IsPlayingNodePaused(npcid);
native FCNPC_IsValidMovePath(pathid); native bool:FCNPC_IsValidMovePath(pathid);
native FCNPC_AddPointToPath(pathid, Float:x, Float:y, Float:z); native FCNPC_AddPointToMovePath(pathid, Float:x, Float:y, Float:z);
native FCNPC_AddPointsToPath(pathid, Float:points[][3], const size = sizeof(points)); native FCNPC_AddPointsToMovePath(pathid, Float:points[][3], const size = sizeof(points));
native FCNPC_AddPointsToPath2(pathid, Float:points_x[], Float:points_y[], Float:points_z[], const size = sizeof(points_x)); native FCNPC_AddPointsToMovePath2(pathid, Float:points_x[], Float:points_y[], Float:points_z[], const size = sizeof(points_x));
native FCNPC_RemovePointFromPath(pathid, pointid); native FCNPC_RemovePointFromMovePath(pathid, pointid);
native FCNPC_IsValidMovePoint(pathid, pointid); native bool:FCNPC_IsValidMovePathPoint(pathid, pointid);
native FCNPC_GetMovePoint(pathid, pointid, &Float:x, &Float:y, &Float:z); native FCNPC_GetMovePathPoint(pathid, pointid, &Float:x, &Float:y, &Float:z);
native FCNPC_GetNumberMovePoint(pathid); native FCNPC_GetNumberMovePathPoint(pathid);
native FCNPC_GoByMovePath(npcid, pathid, type = FCNPC_MOVE_TYPE_AUTO, Float:speed = FCNPC_MOVE_SPEED_AUTO, bool:UseMapAndreas = false, Float:radius = 0.0, bool:setangle = true, Float:dist_offset = 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);

Removed functions

native FCNPC_InitMapAndreas(address);
native FCNPC_ToggleMapAndreasUsage(npcid, bool:enabled);
native FCNPC_IsMapAndreasUsed(npcid);

New functions

native bool:FCNPC_IsReloadingUsed(npcid);
native bool:FCNPC_IsInfiniteAmmoUsed(npcid);
native FCNPC_SetMoveMode(npcid, mode);
native FCNPC_GetMoveMode(npcid);
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_ShowInTabListForPlayer(npcid, forplayerid);
native FCNPC_HideInTabListForPlayer(npcid, forplayerid);
native FCNPC_GetClosestEntityInBetween(npcid, Float:x, Float:y, Float:z, Float:range, between_check_flags = FCNPC_ENTITY_CHECK_ALL, &entity_id = -1, &entity_type = -1, &object_owner_id = INVALID_PLAYER_ID, &Float:point_x = 0.0, &Float:point_y = 0.0, &Float:point_z = 0.0);
#if FCNPC_SAMP_03DL
	native FCNPC_GetCustomSkin(npcid);
#endif
#if defined _streamer_included
	native FCNPC_SetSurfingDynamicObject(npcid, objectid);
	native FCNPC_GetSurfingDynamicObject(npcid);
 #endif

New defines

#define FCNPC_ENTITY_CHECK_NONE           (0)
#define FCNPC_ENTITY_CHECK_PLAYER         (1)
#define FCNPC_ENTITY_CHECK_NPC            (2)
#define FCNPC_ENTITY_CHECK_ACTOR          (4)
#define FCNPC_ENTITY_CHECK_VEHICLE        (8)
#define FCNPC_ENTITY_CHECK_OBJECT         (16)
#define FCNPC_ENTITY_CHECK_POBJECT_ORIG   (32)
#define FCNPC_ENTITY_CHECK_POBJECT_TARG   (64)
#define FCNPC_ENTITY_CHECK_MAP            (128)
#define FCNPC_ENTITY_CHECK_ALL            (255)

#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)

Fixes

  • #78: Add support for quaternion offsets in playback
  • #116: dist_offset renamed to min_distance
  • #119: Add FCNPC_Show/HideInTabListForPlayer functions
  • #97: Remove not working player surfing functions
  • #119: Force restream after showing
  • Fix warnings from PVS-Studio
  • #143: Fix issues with move paths
  • Fixes #141
  • Fixes #140
  • Fixes #144
  • Traindriver & pilots FS
  • Entering vehicle fix
  • Implement new callback hooking process (from YSF)
  • Remove 0.3.7 support (only 0.3.7 R2 still supported)
  • #130: fix nodes
  • Fix callbacks calling with scripts without FCNPC callbacks
  • Fix kicking NPCs by RakNet when player was tried to connect to the full server
  • Fixes #151
  • Fixes #97
  • #170: Close file handle