Introduction
Note: This is the successor of actor plugin.
An attempt to implement Non Playable Characters (NPC) for vc-mp has been made. The working of this may be taken similar to SA-MP.
NPCs also known as bots allows you to create NPCs inside your server who will work like virtual players. Like normal players, they use server slot. Their actions are scripted by squirrel scripts. These scripts with 'artificial intelligence' of NPC reside in npcscripts directory. If you want to have 10 different NPC doing 10 different things, you might want to script 10 different scripts.
Each NPC run in its own process. This might make their usage and working economical. The NPC scripts have functions as well as callbacks.
NPC-Wiki ( Click image to open )

Functions and callbacks documentation
Code: [Select]
Limitation:
Application Download links ( New v1.1 )(Bugs Fixed)
Windows: Windows x86 Windows x64
Linux: Linux x86 Linux x64
Plugin for squirrel download
The downloads contain plugin for squirrel:npc04relxx
This squirrel plugin offers the functions:
Code: [Select]
Click to see the NPC Wiki (fully developed with examples)(host moved, no syntax highlighting)
Source: Click here ( github )
License: GPL v3
Discord:
A discord has been setup at my friends request to discuss about NPC question, answers: here
Tutorials : See the tutorials board or Creating an idle NPC
Video tutorial: Video Tutorial
See them

Note: This is the successor of actor plugin.
An attempt to implement Non Playable Characters (NPC) for vc-mp has been made. The working of this may be taken similar to SA-MP.
NPCs also known as bots allows you to create NPCs inside your server who will work like virtual players. Like normal players, they use server slot. Their actions are scripted by squirrel scripts. These scripts with 'artificial intelligence' of NPC reside in npcscripts directory. If you want to have 10 different NPC doing 10 different things, you might want to script 10 different scripts.
Each NPC run in its own process. This might make their usage and working economical. The NPC scripts have functions as well as callbacks.
NPC-Wiki ( Click image to open )

Functions and callbacks documentation
---------------------------------------------------------------------------
NPC Callbacks
---------------
OnNPCScriptLoad()
OnNPCScriptUnload()
OnNPCConnect([integer] myplayerid)
OnNPCDisconnect([integer] reason)
OnNPCSpawn()
OnNPCEnterVehicle([integer] vehicleid, [integer] seatid )
OnNPCExitVehicle()
OnClientMessage([integer] r, [integer] g, [integer] b, [string] message )
OnPlayerDeath([integer] playerid )
OnPlayerText([integer] playerid, [string] message )
OnPlayerStreamIn([integer] playerid )
OnPlayerStreamOut([integer] playerid )
OnVehicleStreamIn([integer] vehicleid )
OnVehicleStreamOut([integer[ vehicleid )
OnRecordingPlaybackEnd()
-------------------------------------------------------------------------------
--------------
NPC Functions
--------------
StartRecordingPlayback([integer] playbacktype, [string] recordname )
StopRecordingPlayback()
PauseRecordingPlayback()
ResumeRecordingPlayback()
SendChat([string] text)
SendCommand([string] command) //without '/'
GetMyPos()
SetMyPos( [Vector] position )
GetMyFacingAngle()
SetMyFacingAngle( [float] angle ) //in radians
GetDistanceFromMeToPoint( [Vector] point )
IsVehicleStreamedIn( [integer] vehicleid )
IsPlayerStreamedIn( [integer] playerid )
[integer] SetTimer( [string] FunctionName, [integer] interval, [integer] repeat) //repeat=1 means loop
KillTimer( [integer] timerid )
[integer] GetPlayerState( [integer] playerid )
[Vector] GetPlayerPos( [integer] playerid )
[integer] GetPlayerVehicleID( [integer] playerid )
[integer] GetPlayerArmedWeapon( [integer] playerid )
[integer] GetPlayerHealth( [integer] playerid )
[integer] GetPlayerArmour( [integer] playerid )
[integer] GetPlayerKeys( [integer] playerid )
[float(in radians)] GetPlayerFacingAngle( [integer] playerid )
[bool]IsPlayerInRangeOfPoint( [integer] playerid, [float] radius, [Vector] point )
[string/null] GetPlayerName( [integer] playerid )
[bool] IsPlayerConnected( [integer] playerid )
----------------------------------------------------------------------------------------------------------------
Constants
---------
PLAYER_RECORDING_TYPE_ONFOOT <- 1
PLAYER_RECORDING_TYPE_DRIVER <- 2
MAX_PLAYERS <- 100
MAX_PLAYER_NAME <- 24
MAX_VEHICLES <- 1000
INVALID_PLAYER_ID <- 0xFF
INVALID_VEHICLE_ID <- 0
PLAYER_STATE_NONE <- 0
PLAYER_STATE_ONFOOT <- 1
PLAYER_STATE_AIM <- 2
PLAYER_STATE_DRIVER <- 3
PLAYER_STATE_PASSENGER <- 4
PLAYER_STATE_ENTER_VEHICLE_DRIVER <- 5
PLAYER_STATE_ENTER_VEHICLE_PASSENGER<- 6
PLAYER_STATE_EXIT_VEHICLE <- 7
PLAYER_STATE_WASTED <- 8
PLAYER_STATE_SPAWNED <- 9
Limitation:
Application Download links ( New v1.1 )(Bugs Fixed)
Windows: Windows x86 Windows x64
Linux: Linux x86 Linux x64
Plugin for squirrel download
The downloads contain plugin for squirrel:npc04relxx
This squirrel plugin offers the functions:
Squirrel Add-On Plugin npc04relxx functions
-------------------------------------------
ConnectNPC( [string] name, [string] script, [string] host="127.0.0.1")
[bool]IsPlayerNPC( [integer] playerid )
[bool]StartRecordingPlayerData( [integer] playerid, [integer] recordtype, [string]recordname )//recordname without .rec extn
[bool]StopRecordingPlayerData( [integer] playerid )
Click to see the NPC Wiki (fully developed with examples)(host moved, no syntax highlighting)
Source: Click here ( github )
License: GPL v3
Discord:
A discord has been setup at my friends request to discuss about NPC question, answers: here
Tutorials : See the tutorials board or Creating an idle NPC
Video tutorial: Video Tutorial
See them
