How do I make a NPC to attack
#1

I have spend 3-4 hours searching for it but I can't find one that's working. I have tried FCNPC and ARNPC, FCNPC crashes my map editor server but it works fine on my zm server, ARNPC doesn't seem reliable but I'll try it tomorrow. Also RNPC, about RNPC, I do not understand how the shooting system works, in https://sampwiki.blast.hk/wiki/Rnpc#Walk...and_rage-shoot it says

Код:
RNPC_SetKeys(128); // aim straight forward
RNPC_SetKeys(128 + 4); // Start shooting straight forward
But I don't know how it works. In https://sampforum.blast.hk/showthread.php?tid=358655 (http://pastebin.com/4SrEhUk7) it says

Код:
// Set facing angle to the target
RNPC_SetAngleQuats(0.0, angle, 0.0);
// Start firing
RNPC_SetKeys(KEY_FIRE);
doesn't really explains how to use the shooting system, I'm guessing that if we set the RNPC_SetKeys to LMB/KEY_FIRE the NPC will start shooting?

And when I include the RNPCText filterscript, this is my server log

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[01:20:59] 
[01:20:59] Server Plugins
[01:20:59] --------------
[01:20:59]  Loading plugin: Whirlpool
[01:20:59]  
[01:20:59]  ==================
[01:20:59]  
[01:20:59]   Whirlpool loaded
[01:20:59]  
[01:20:59]  ==================
[01:20:59]  
[01:20:59]   Loaded.
[01:20:59]  Loading plugin: sscanf
[01:20:59] 

[01:20:59]  ===============================

[01:20:59]       sscanf plugin loaded.     

[01:20:59]    © 2009 Alex "******" Cole

[01:20:59]    0.3d-R2 500 Players "dnee"

[01:20:59]  ===============================

[01:20:59]   Loaded.
[01:20:59]  Loading plugin: regex
[01:20:59] 


[01:20:59] ______________________________________


[01:20:59]  Regular Expression Plugin v0.2.1 loaded
[01:20:59] ______________________________________


[01:20:59]  By: Fro © Copyright <TBG> 2009-2011
[01:20:59] ______________________________________


[01:20:59]   Loaded.
[01:20:59]  Loading plugin: nativechecker
[01:20:59]   Loaded.
[01:20:59]  Loading plugin: FCNPC
[01:20:59] 
[01:20:59] -------------------------------------------------
[01:20:59]      FCNPC - Fully Controllable NPC v0.1 B8 R2
[01:20:59] 
[01:20:59] - Author: OrMisicL
[01:20:59] - Build:  May 15 2013 at 12:22:37
[01:20:59] -------------------------------------------------
[01:20:59] 
[01:20:59] Loading ...
[01:20:59] FCNPC Loaded.
[01:20:59] 
[01:20:59]   Loaded.
[01:20:59]  Loading plugin: RNPC
[01:20:59] RNPC V0.3.1 by Mauzen (21.12.2012)
[01:20:59]   Loaded.
[01:20:59]  Loaded 6 plugins.

[01:20:59] 
[01:20:59] Filterscripts
[01:20:59] ---------------
[01:20:59]   Loading filterscript 'announcement_system.amx'...
[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |      Announcement System      | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2012)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59]   Loading filterscript 'user_account_system.amx'...
[01:20:59]  
[01:20:59]  ======================================= 
[01:20:59]  |                                     | 
[01:20:59]  |        YSI version 3.01.0002        | 
[01:20:59]  |        By Alex "******" Cole        | 
[01:20:59]  |                                     | 
[01:20:59]  ======================================= 
[01:20:59]  
[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |      User Account System      | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2012)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59]   Loading filterscript 'kill_streak_system.amx'...
[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |      Kill Streak System       | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2012)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59]   Loading filterscript 'commands_system.amx'...
[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |        Commands System        | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2012)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59]   Loading filterscript 'vehicle_system.amx'...
[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |        Vehicle System         | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2012)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59]   Loading filterscript 'RNPCTest.amx'...
[01:20:59]    Error: Function not registered: 'RNPC_SetAngleQuats'
[01:20:59]    Error: Function not registered: 'RNPC_SetKeys'
[01:20:59]    Error: Function not registered: 'RNPC_SetLRKeys'
[01:20:59]    Error: Function not registered: 'RNPC_SetUDKeys'
[01:20:59]    Error: Function not registered: 'RNPC_SetSpecialAction'
[01:20:59]    Error: Function not registered: 'RNPC_SetWeaponID'
[01:20:59]    Error: Function not registered: 'RNPC_ConcatMovement'
[01:20:59]    Error: Function not registered: 'RNPC_AddMovement'
[01:20:59]    Error: Function not registered: 'RNPC_AddPause'
[01:20:59]    Error: Function not registered: 'RNPC_CreateBuild'
[01:20:59]    Error: Function not registered: 'RNPC_FinishBuild'
[01:20:59] OnFilter
[01:20:59]   Loaded 6 filterscripts.

[01:20:59] 
 ================================= 
[01:20:59]  |                               | 
[01:20:59]  |  Z-Zone Outbreak V1.0 [0.3x]  | 
[01:20:59]  |                               | 
[01:20:59]  |       By SlonCHL (2013)       | 
[01:20:59]  |                               | 
[01:20:59]  ================================= 

[01:20:59] Number of vehicle models: 0
[01:20:59]  
[01:20:59]
I somehow like the simple and easy function of FCNPC but it's kinda buggy to be used

Код:
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
Can anyone teach me how to use the RNPC shooting system or how it works, I just need a code to make a NPC attack a player(with both melee and guns)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)