Freaksken edited this page Jun 27, 2018 · 38 revisions

Everything in the plugin is prefixed with FCNPC_.
Questions can be asked in the forum thread, or in the Russian forum thread.



The latest version can be found on the releases page.


  • Add a maxnpc line in the server.cfg file if one does not already exist and set it to the maximum amount of NPCs you want. Make sure it is not more than maxplayers, else increase that value.
  • Create a plugins folder in the root of the server directory if one does not already exist.
  • Put the FCNPC.dll file (for Windows) or the file (for Linux) in the plugins folder.
  • Add a plugins line in the server.cfg file if one does not already exist.
  • Add FCNPC (for Windows) or (for Linux) to that line. If there is already another plugin on that line, separate the plugins by using a space between them.
  • Put the file in the pawno/include folder.
  • Put #include <FCNPC> in the filterscript/gamemode you want to use the plugin in.
  • Enable lag compensation in server.cfg if not done already. This is to ensure that OnPlayerWeaponShot will be called, and as a result NPC vehicle damage will work.
  • If your NPCs will use MapAndreas, initialize MapAndreas as follows if not done already in one of your scripts in which you want to use FCNPC. If your script is a gamemode, put the following lines under OnGameModeInit. If it is a filterscript, put them under OnFilterScriptInit.

Simplest Example Script

This example filterscript creates an NPC named FirstNPC and spawns him at the center of the map. More advanced examples can be found here.

#include <a_samp>
#include <FCNPC>


#if defined FILTERSCRIPT
public OnFilterScriptInit()
	myFirstNPC = FCNPC_Create("FirstNPC");
	FCNPC_Spawn(myFirstNPC, 0, 0.0, 0.0, 3.1);
	return 1;

public OnFilterScriptExit()
	return 1;

FCNPC Developers

If you would like to help develop this plugin, you need to download the sources and build the project.


To download the sources, use the following git command:

git clone --recursive

Note the use of the --recursive argument, because this repository contains submodules.


To build the project you can use Visual Studio. To generate the project you can use CMake.
On Windows, execute the following commands. This example is for Visual Studio 15 2017:

mkdir build
cd build
cmake .. -G "Visual Studio 15 2017"

On Linux, execute the following commands:

mkdir build
cd build
cmake ..
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.