Releases: ziggi/FCNPC
Releases · ziggi/FCNPC
FCNPC 1.1.1
Version notes
- Surfing now supports attached objects
- Optimization
- Add speed definitions in the include file
- Update load message
Fixes
- Fix object and vehicle validation (less crashes)
- Fix include version checks (thanks to Incognito streamer plugin for example)
- Fix move radius for goto player
- Fixed variable types and casts
- Fix speed and type argument in GoTo function
- Fix train speed bug
- Fix sync for hydra thrusters and train speed in playbacks
- Fix some crashes after destroying NPC vehicle
New defines
#define MOVE_SPEED_AUTO (-1.0)
#define MOVE_SPEED_WALK (0.1552086)
#define MOVE_SPEED_RUN (0.56444)
#define MOVE_SPEED_SPRINT (0.926784)FCNPC 1.1.0
Version notes
- Improve target detection in FCNPC_AimAt function
- Now NPC can give damage to another NPC (for prevent this you can return 0 in FCNPC_OnTakeDamage)
- Add include file version check
- Now FCNPC_GoToPlayer update the NPC destination point while player changes the position
- Add vehicle hydra thrusters control functions
- Add vehicle gear state functions
- Default shoot_delay changed to -1 (not important)
- Optimization for aim process
- Small source code refactoring
Fixes
- Fixed crash for invalid vehicle in playback
- Fixed NPC surfing position sync
- Fixed shooting while surfing
- Fixed speed argument in FCNPC_GoTo[Player] functions (now it works for on foot state)
- Fixed up/down direction for aiming Z angle
- Reset NPC keys after death (fixed some animation bugs)
- Fixed checks for params in weapon info functions
New functions
native FCNPC_StopSurfing(npcid);
native FCNPC_IsAttacking(npcid);
native FCNPC_IsAimingAtPlayer(npcid, playerid);
native FCNPC_IsMovingAtPlayer(npcid, playerid);
native FCNPC_SetVehicleHydraThrusters(npcid, direction);
native FCNPC_GetVehicleHydraThrusters(npcid);
native FCNPC_SetVehicleGearState(npcid, gear_state);
native FCNPC_GetVehicleGearState(npcid);FCNPC 1.0.7
- Fixed movement keys (caused some bugs with movement animation)
- Fixed body disappearance (#15)
- Added check on MapAndreas address (no more crash if address is invalid)
- Added some checks for input parameters
- Removed reset the aiming data in MeleeAttack (now you can use FCNPC_AimAtPlayer with FCNPC_MeleeAttack)
- FCNPC_AimAt(Player) now stop aiming before start new
- Fixed and optimized callback hooking process (now it works perfectly with filterscripts)
- Fixed return actions in callbacks (now it works)
- Optimization (just a little)
FCNPC 1.0.6
Version notes
- Add UD and LR analog params to FCNPC_SetKeys
Fixes
- Fix take damage in Bodyguard sample script
- Fix NPC reincarnation after restream
- Set correct keys for NPCs moving
- Fix crash after NPC kick
- Fix kill NPC reason and killerid
Changed functions
native FCNPC_SetKeys(npcid, ud_analog, lr_analog, keys);FCNPC 1.0.5
Version notes
- Lower case for nodes folder (now path looks like this: scriptfiles/FCNPC/nodes/NODES%d.DAT);
- Add node files into repository and windows archive.
Fixes
- Fix and optimization some sample scripts (citizens, missions);
- Fix playback system (now it's works);
New functions
native FCNPC_IsStreamedForAnyone(npcid);FCNPC 1.0.4
Version notes
- Small bug fix update.
Fixes
- Server crashes after KillPlayer call.
FCNPC 1.0.3
Version notes
- New param for FCNPC_AimAt[Player] - setangle;
- Internal loop optimization;
- Removed Set/Get damage functions, callbacks and params;
- Removed FCNPC_OnGiveDamage callback.
- Removed DriveBy functions;
(removed because this stuff does not works properly)
Fixes
- Fix NPCs weapon state;
- Memory cleaning for some pointers.
FCNPC 1.0.2
Version notes
- FCNPC_EnterVehicle now works close to perfect;
- FCNPC_SetWeaponDamage now works, not perfect, but works;
- FCNPC_SetSkin now works perfect (without NPC restream);
- More information in crash log.
Fixes
- FCNPC_ExitVehicle;
- FCNPC_SetWeaponDamage;
- Vehicle entering and setting angle;
- NPC connection on servers with one available slot;
- Crash for ammo with clipsize = 0;
- Default weapon damage values.
New callbacks
forward FCNPC_OnGiveDamage(npcid, damagedid, weaponid, bodypart, Float:health_loss);FCNPC 1.0.1
Version notes
- Now we have two different methods of setting animation to NPC:
- FCNPC_SetAnimation[ByName], FCNPC_ResetAnimation: works with sync
data. Animation is replayed after restreaming. Needs to use
FCNPC_ResetAnimation (with small delay) before replay the current
animation. - FCNPC_ApplyAnimation, FCNPC_ClearAnimations: sends RPC packets to
streamed players, works like ApplyAnimation.
- FCNPC_SetAnimation[ByName], FCNPC_ResetAnimation: works with sync
Fixes
- OnPlayerGiveDamage crash
- MAX_PLAYER validation
- Some variable types
New functions
native FCNPC_SetAnimationByName(npcid, name[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1);
native FCNPC_ResetAnimation(npcid);
native FCNPC_ApplyAnimation(npcid, animlib[], animname[], Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1);
native FCNPC_ClearAnimations(npcid);Note: parameter name[] in FCNPC_SetAnimationByName have mask LIBNAME:ANIMNAME, example: PED:WALK_DRUNK.
FCNPC 1.0.0
Version notes
- NPC in a vehicle could be killed;
- If NPC is a driver, his car could be damaged (to disable this, return 0 in the public FCNPC_OnVehicleTakeDamage);
- OnPlayerStreamIn/Out are no longer called for the FCNPC (use FCNPC_OnStreamIn / Out);
- NPC could be attached to a vehicle/object/player object (including offset changing);
- NPC vehicle siren status control;
- NPC vehicle health control;
- Damage, magazine, fire and reload rates for each NPC are able to control;
- Weaponskill for a weapon is able to control (the system changes the damage for one handed and double handed weapons);
- Grenade shot power could be controlled by shoot_delay in the function FCNPC_AimAt;
- UseFightstyle parameter has been added for FCNPC_MeleeAttack function;
- Delay parameter has been added in FCNPC_MeleeAttack function;
- FCNPC_GoTo function has been modified: now you can turn off automatic changing angle (useful for use with FCNPC_SetQuaternion);
- FCNPC_SetSkin function no longer respawn NPC, now it's restream NPC;
- New function to control NPC's angle has been added (FCNPC_SetAngleToPos, FCNPC_SetAngleToPlayer);
- Invulnerable function has been added (FCNPC_SetInvulnerable, FCNPC_IsInvulnerable);
- New value for move type parameter has been added in FCNPC_GoTo function - MOVE_TYPE_AUTO, which is automatically checking is NPC in a vehicle;
- New parameter has been added in FCNPC_GoTo function - radius, which is direct NPC to random coordinates within the radius of point;
- NPC animation control has been added (FCNPC_SetAnimation, FCNPC_GetAnimation).
Fixes
- NPC doesn't give damage with firearm;
- NPC's angle is changing after putting him into a vehicle;
- NPC attack after the spawn;
- NPC doesn't shoot after first reload;
- Validation of skins for SA-MP 0.3.7.
Internal changes
- Fully support Windows and Linux SA-MP 0.3.7 and 0.3.7 R2-1 versions;
- Vehicle passenger seat validation has been added;
- MapAndreas 1.2.1 has been implemented (http://forum.sa-mp.com/showpost.php?p=3130004&postcount=153);
- A lot of code changes (replacing Detours by subhook, CMake building, YSF Structs.h implemented, replaced unsafe functions, optimization, etc.).
New functions
native FCNPC_InitMapAndreas(address);
native FCNPC_IsValid(npcid);
native FCNPC_IsStreamedIn(npcid, forplayerid);
native FCNPC_SetAngleToPos(npcid, Float:X, Float:Y);
native FCNPC_SetAngleToPlayer(npcid, playerid);
native FCNPC_SetInvulnerable(npcid, bool:invulnerable = true);
native FCNPC_IsInvulnerable(npcid);
native FCNPC_SetWeaponSkillLevel(npcid, skill, level);
native FCNPC_GetWeaponSkillLevel(npcid, skill);
native FCNPC_SetWeaponState(npcid, weaponstate);
native FCNPC_GetWeaponState(npcid);
native FCNPC_SetWeaponDamage(npcid, weaponid, Float:damage);
native Float:FCNPC_GetWeaponDamage(npcid, weaponid);
native FCNPC_SetWeaponReloadTime(npcid, weaponid, time);
native FCNPC_GetWeaponReloadTime(npcid, weaponid);
native FCNPC_SetWeaponShootTime(npcid, weaponid, time);
native FCNPC_GetWeaponShootTime(npcid, weaponid);
native FCNPC_SetWeaponClipSize(npcid, weaponid, size);
native FCNPC_GetWeaponClipSize(npcid, weaponid);
native FCNPC_SetWeaponInfo(npcid, weaponid, Float:damage = -1.0, reload_time = -1, shoot_time = -1, clip_size = -1);
native FCNPC_GetWeaponInfo(npcid, weaponid, &Float:damage = -1.0, &reload_time = -1, &shoot_time = -1, &clip_size = -1);
native FCNPC_SetWeaponDefaultInfo(weaponid, Float:damage = -1.0, reload_time = -1, shoot_time = -1, clip_size = -1);
native FCNPC_GetWeaponDefaultInfo(weaponid, &Float:damage = -1.0, &reload_time = -1, &shoot_time = -1, &clip_size = -1);
native FCNPC_SetAnimation(npcid, animationid, Float:fDelta = 4.1, loop = 0, lockx = 1, locky = 1, freeze = 0, time = 1);
native FCNPC_GetAnimation(npcid, &animationid = 0, &Float:fDelta = 4.1, &loop = 0, &lockx = 1, &locky = 1, &freeze = 0, &time = 1);
native FCNPC_SetFightingStyle(npcid, style);
native FCNPC_GetFightingStyle(npcid);
native FCNPC_GoTo(npcid, Float:X, Float:Y, Float:Z, type = MOVE_TYPE_AUTO, Float:speed = 0.5, bool:UseMapAndreas = false, Float:radius = 0.0, bool:getangle = true); // updated
native FCNPC_GoToPlayer(npcid, playerid, type = MOVE_TYPE_AUTO, Float:speed = 0.5, bool:UseMapAndreas = false, Float:radius = 0.0, bool:getangle = true);
native FCNPC_AimAt(npcid, Float:X, Float:Y, Float:Z, bool:shoot = false, shoot_delay = 0); // updated
native FCNPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shoot_delay = 0);
native FCNPC_MeleeAttack(npcid, delay = -1, bool:fightstyle = false); // updated
native FCNPC_EnterVehicle(npcid, vehicleid, seatid, type = MOVE_TYPE_WALK); // updated
native FCNPC_SetVehicleSiren(npcid, bool:status);
native FCNPC_IsVehicleSiren(npcid);
native FCNPC_SetVehicleHealth(npcid, Float:health);
native Float:FCNPC_GetVehicleHealth(npcid);
native FCNPC_SetSurfingOffsets(npcid, Float:fX, Float:fY, Float:fZ);
native FCNPC_GetSurfingOffsets(npcid, &Float:fX, &Float:fY, &Float:fZ);
native FCNPC_SetSurfingVehicle(npcid, vehicleid);
native FCNPC_GetSurfingVehicle(npcid);
native FCNPC_SetSurfingObject(npcid, objectid);
native FCNPC_GetSurfingObject(npcid);
native FCNPC_SetSurfingPlayerObject(npcid, objectid);
native FCNPC_GetSurfingPlayerObject(npcid);New callbacks
forward FCNPC_OnVehicleTakeDamage(npcid, damagerid, vehicleid, weaponid, Float:fX, Float:fY, Float:fZ);
forward FCNPC_OnStreamIn(npcid, forplayerid);
forward FCNPC_OnStreamOut(npcid, forplayerid);