Help Me In FCNPC Plugins | REP+
#1

hello, i loaded FCNPC plugins, but its show


Код:
Failed. <Error:File "scriptfiles/FCNPC/ZMap.hmap" is not found>

 Failed

Loaded 0 Plugins.
Reply
#2

I hope this works for you

Introduction

Yes, this plugin gives you full control over the server NPCs, it looks like the old CNPC plugin, but its very different from it. Im releasing it because i have seen many people requesting this and hoping to see it
I also took authorization from the SAMP team to release as there is no harm that can be caused by my plugin (it uses a very different way of creating NPCs that dosent allow anyone to change them to fake players)

Features

+50 functions to control all the aspects of the NPC

NPC damage detection

NPC mouvement sync (walk, run, sprint ...)

Vehicle entry and exit sync (not perfect but still good)

Functions

FCNPC_Create

Parameters:
name: the desired NPC name

Return:
The id of the created NPC (NOTE: The NPC ID returned by this function is a unique ID generated by the plugin and does not have any relation with the SAMP PlayerPool ID)

FCNPC_Destroy

Parameters:
ID: the NPC ID to destroy

Return: None

FCNPC_Spawn

Parameters:
ID: the NPC ID to spawn
skinid: the NPC skin to spawn with
X: the X coord to spawn
Y: the Y coord to spawn
Z: the Z coord to spawn

Return:
1 if the NPC is successfully spawned, 0 if not

FCNPC_Respawn

Parameters:
ID: the NPC ID to respawn

Return:
1 if the NPC is successfully respawned, 0 if not

FCNPC_Kill

Parameters:
ID: the NPC ID to kill

Return: None

FCNPC_IsDead

Parameters:
ID: the NPC ID to check for death

Return:
1 if the NPC is dead, 0 if not

FCNPC_SetPosition

Parameters:
ID: the NPC ID
X: the X coord to set
Y: the Y coord to set
Z: the Z coord to set

Return: None

FCNPC_GetPosition

Parameters:
ID: the NPC ID
X: the X coord to get
Y: the Y coord to get
Z: the Z coord to get

Return: None

FCNPC_SetAngle

Parameters:
ID: the NPC ID
A: the angle value to set

Return: None

FCNPC_GetAngle

Parameters:
ID: the NPC ID

Return:
The angle value

FCNPC_SetVelocity

Parameters:
ID: the NPC ID
X: the X coord to set
Y: the Y coord to set
Z: the Z coord to set

Return: None

FCNPC_GetVelocity

Parameters:
ID: the NPC ID
X: the X coord to get
Y: the Y coord to get
Z: the Z coord to get

Return: None

FCNPC_SetQuaternion

Parameters:
ID: the NPC ID
X: the X coord to set
Y: the Y coord to set
Z: the Z coord to set
A: the angle to set

Return: None

FCNPC_GetQuaternion

Parameters:
ID: the NPC ID
X: the X coord to get
Y: the Y coord to get
Z: the Z coord to get
A: the quaternion angle to get

Return: None

FCNPC_SetInterior

Parameters:
ID: the NPC ID
interior: the interior value to set

Return: None

FCNPC_GetInterior

Parameters:
ID: the NPC ID

Return:
The interior ID

FCNPC_SetHealth

Parameters:
ID: the NPC ID
health: the health value to set

Return: None

FCNPC_GetHealth

Parameters:
ID: the NPC ID

Return:
The NPC health

FCNPC_SetArmour

Parameters:
ID: the NPC ID
armour: the armour value to set

Return: None

FCNPC_GetArmour

Parameters:
ID: the NPC ID

Return:
The NPC armour value

FCNPC_SetSkin

Parameters:
ID: the NPC ID
skinid: the skin ID to set

Return: None

Note: This will respawn the NPC in order for the changes to take effect

FCNPC_GetSkin

Parameters:
ID: the NPC ID

Return:
The NPC skin ID

FCNPC_SetSpecialAction

Parameters:
ID: the NPC ID
actionid: the action id to perform

Return: None

FCNPC_GetSpecialAction

Parameters:
ID: the NPC ID

Return:
The special action ID

FCNPC_SetWeapon

Parameters:
ID: the NPC ID
weaponid: the weapon ID to give

Return: None

FCNPC_GetWeapon

Parameters:
ID: the NPC ID

Return:
The NPC weapon ID

FCNPC_SetAmmo

Parameters:
ID: the NPC ID
ammo: the ammo to give

Return: None

FCNPC_GetAmmo

Parameters:
ID: the NPC ID

Return:
The NPC ammo value

FCNPC_SetKeys

Parameters:
ID: the NPC ID
keys: the keys to set for the player (No analogs)

Return: None

FCNPC_GetKeys

Parameters:
ID: the NPC ID
UDAnalog: the up/down analog value
LRAnalog: the left/right analog value
keys: the NPC keys

Return: None

FCNPC_GoTo

Parameters:
ID: the NPC ID
X: the X coordinate to go to
Y: the Y coordinate to go to
Z: the Z coordinate to go to
type: mouvement type
MOVE_TYPE_WALK: Walk the NPC
MOVE_TYPE_RUN: Run the NPC
MOVE_TYPE_SPRINT: Sprint the NPC
MOVE_TYPE_DRIVE: Drive the NPC (only in car)

Return: None

FCNPC_Stop

Parameters:
ID: the NPC ID

Return: None

FCNPC_IsMoving

Parameters:
ID: the NPC ID

Return:
1 if moving, 0 if not

FCNPC_AimAt

Parameters:
ID: the NPC ID
X: the X coordinate to aim at
Y: the Y coordinate to aim at
Z: the Z coordinate to aim at
shoot: 1 to make the NPC shoot, 0 to aim only
Return: None

FCNPC_StopAim

Parameters:
ID: the NPC ID

Return: None

FCNPC_IsAiming

Parameters:
ID: the NPC ID

Return:
1 if aiming, 0 if not

FCNPC_IsShooting

Parameters:
ID: the NPC ID

Return:
1 if shooting, 0 if not

FCNPC_IsReloading

Parameters:
ID: the NPC ID

Return:
1 if reloading, 0 if not

FCNPC_EnterVehicle

Parameters:
ID: the NPC ID
vehicleid: the vehicle ID to enter
seat: the NPC seat in vehicle

Return:
1 if sucessfully entering, 0 if not

Note: This will make the NPC go to the vehicle and TRY to perform the enter vehicle animation, you may notice that sometimes the NPC enters the vehicle even before doing the animation (because we dont have each vehicle door coordinates)

FCNPC_ExitVehicle

Parameters:
ID: the NPC ID

Return:
1 if sucessfully exiting, 0 if not

Note: This will perform the exit vehicle animation and wait for some time before the NPC state will be onfoot, and you may notice that the NPC changes position after exiting vehicle (because we dont have each vehicle door coordinates)

FCNPC_PutInVehicle

Parameters:
ID: the NPC ID
vehicleid: the vehicle ID to enter
seat: the NPC seat in vehicle

Return:
1 if sucessfully put in vehicle, 0 if not

FCNPC_RemoveFromVehicle

Parameters:
ID: the NPC ID

Return:
1 if sucessfully removed from the vehicle, 0 if not

FCNPC_GetVehicleID

Parameters:
ID: the NPC ID

Return:
Returns the vehicle ID if he has any or INVALID_VEHICLE_ID if he's not in any vehicle

FCNPC_GetVehicleSeat

Parameters:
ID: the NPC ID

Return:
Returns the seat ID if he has any or ( 128 ) if he's not in any vehicle

FCNPC_StartRecordingPlayback

Parameters:
ID: the NPC ID
File: the recorded file name (should be located in "npcmodes/recordings/")

Return:
Returns 1 if the recording has successfully started, 0 otherwise

FCNPC_StopRecordingPlayback

Parameters:
ID: the NPC ID

Return:
Returns 1 if the recording has successfully stopped, 0 otherwise

FCNPC_PauseRecordingPlayback

Parameters:
ID: the NPC ID

Return: None

FCNPC_ResumeRecordingPlayback

Parameters:
ID: the NPC ID

Return: None


Callbacks

FCNPC_OnCreate

Description: gets called when the NPC is created

Parameters:
npcid: the NPC ID

Return: None

FCNPC_OnSpawn

Description: gets called when the NPC is spawned

Parameters:
npcid: the NPC ID that spawned

Return: None

FCNPC_OnRespawn

Description: gets called when the NPC is respawned

Parameters:
npcid: the NPC ID that spawned

Return: None

FCNPC_OnDeath

Description: gets called when the NPC is dead

Parameters:
npcid: the NPC ID that died
killerid: the player ID that killed the NPC ( INVALID_PLAYER_ID if the NPC has died )
weaponid: the weapon id in which the NPC was killed with

Return: None

FCNPC_OnReachDestination

Description: gets called when the NPC has reached his destination (FCNPC_GoTo)

Parameters:
npcid: the NPC ID

Return: None

FCNPC_OnVehicleEntryComplete (Not implemented yet)

Description: gets called when the NPC has completed his vehicle entry (FCNPC_EnterVehicle)

Parameters:
npcid: the NPC ID
vehicleid: the vehicle ID
seat: the seat ID

Return: None

FCNPC_OnVehicleExitComplete (Not implemented yet)

Description: gets called when the NPC has completed his vehicle exit(FCNPC_ExitVehicle)

Parameters:
npcid: the NPC ID

Return: None

FCNPC_OnTakeDamage (Not implemented yet)

Description: gets called when the NPC got damaged

Parameters:
npcid: the NPC ID that died
damagerid: the player ID that damagedthe NPC
weaponid: the weapon id in which the NPC was damaged with

Return: None


Installation

Put "FCNPC.dll" or "FCNPC.so" in your "plugins" folder

Put "FCNPC.inc" in your include "pawno/includes" folder

Add "FCNPC" to the plugins list in "server.cfg"


Requirements

Latest version of the SAMP server (0.3x R1-2)


Download

****** Code
Compiled files (aswell as include and sample file) are included in the "Download" tab in ****** code

Notes

This is a beta release only and may contain bugs and may not be stable, please report any bugs/crashes that you find

I took authorization from the SAMP team to release this plugin so dont ask about that

The plugin is a memory hacking plugin which means it should be updated with every server update, but i'll try to keep it always up to date and working with the latest version of the SAMP server

This plugin is different from the old CNPC plugin and dosent have any relation with it (only the idea maybe?) as its coded entirely by me only from scratch

Dont ask to provide mirrors for this plugin, the only downloading sources are listed above in the "Download" section

This plugin is coded to work on both windows and linux, but as i have no knowledge with linux compiling, im requesting somebody experienced to compile the ".so" version of this plugin ( shame on me )


Scripting Notes

After calling "FCNPC_Create" you cannot directly start performing actions on the NPC because the NPC isnt created yet, you just have to move all your setup code under "FCNPC_OnCreate" to make sure the npc is successfully created
Example:
pawn Code:

new id = FCNPC_Create("mybot");
// This is wrong as we're not sure whether the NPC was created or not and will probably crash the server
FCNPC_Spawn(id, 0, SpawnX, SpawnY, SpawnZ);
FCNPC_SetWeapon(id, 22);
// ...


pawn Code:

new id = FCNPC_Create("mybot");
// ...

public FCNPC_OnCreate(npcid)
{
// This is the correct way to do, because now we are sure that the NPC is created
FCNPC_Spawn(npcid, 0, SpawnX, SpawnY, SpawnZ);
FCNPC_SetWeapon(npcid, 22);
// ...
return 1;
}

The NPC ID returned by the create native isnt the same as the server's bot ID, so using that id with the default SAMP functions will simply not work

This will come later


Changelog

Beta 1 R2:
Fixed port issue


Bugs

Vehicle entry and exit are not well synced for the moment (gotta figure out a way of doing it in a proper way)

Damage detection is not that perfect too (fix that aswell)
Reply
#3

thanks for the link. but, after i download the new fcnpc plugin. i got this

Код:
Unknown samp server version. FCNPC only supports 0.3z versions
i already used latest server version.
Reply
#4

Ok bro, Here is the new version
https://sampforum.blast.hk/showthread.php?tid=469691
Reply
#5

That shouldn't create a problem if your server pack is 0.3z version, also it doesnt mean your samp client but the server pack, you can get the latest pack from sa-mp.com/download, Try it and if it doesnt work please let us know.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)