Skip to content

FCNPC 1.0.0

Choose a tag to compare

@ziggi ziggi released this 21 Feb 20:57
· 692 commits to master since this release

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