SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 02/02/2013, 06:31 PM   #1
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,334
Reputation: 251
Default ARNPC - Advanced Recordfree NPC

Advanced Recordfree NPC (ARNPC) -

Introduction

Hey everybody. Today I'm going to release my ARNPC (Advanced Recordfree NPC). I think this is going to be useful specialy for who is going to use NPC on their servers.
This include has many features and very simple to use. This include is based on Mauzen's RNPC plugin!


Why this?
Since many people (mostly the newbie) has a lot of problems on using the RNPC plugin itself, this include gives you a simple way to manage your NPCs.

How to install?
This include is very simple to install, you just need very basic knowlage of how SA-MP Server package is structured.
  • Copy "a_rnpc.inc & YSI folder" to "pawno\include" directory
  • Copy "rnpc.dll or rnpc.so" to your "plugins" directory
  • Copy "RNPC.amx and RNPC.pwn (optional)" to your "npcmodes" directory

That's all. Now just go to your Gamemode/Filterscript and include the library using
pawn Code:
#include <a_rnpc>
on the top as any other include.



Changelog
Code:
  • 02/02/2013 - 1.0 Beta release
  • 02/02/2013 - 1.0 RC1 release: - Fixed bug when npc moves the guns disappear.
  • 05/02/2013 - 1.0 RC2 release: - Fix: SetRNPCHealth and SetRNPCArmour works perfectly - Add: SetRNPCSkillLevel function - Add: OnRNPCDeath callback - Fix: RNPC_StopPlayback is now WORKING! NOTE: Re-download RNPC.pwn & RNPC.amx and put them on npcmodes folder if you're running RC1 or less.
  • 14/02/2013 - 1.1 Stable release - Add: RNPCFollowPlayer - Add: RNPCShotAt / RNPCAimAt - Add: SetRNPCVehicleSiren / GetRNPCVehicleSiren - Fix: Fixed problem when a NPC connect with a previous ID it starts with the previous record. - Fix: Fixed npc angle on spawn point - Add: RNPCStopUseWeapon
  • 21/08/2013 - 1.1 R2 Review version - Now NPCs can connect even on loop (remember that npcs will connect itself after all them load) - Fixed when OnPlayerConnect gets called once on multiple connections - Added a simply Virtualworld for NPCs
Functions & Callbacks
pawn Code:
Functions
/*
// core
native CreateRNPC(npcname[])
native DestroyRNPC(npcid)
native IsPlayerRNPC(npcid)
native GetRNPCID(npcid)
native GetRNPCState(npcid)
native GetRNPCName(npcid)
native SetRNPCVirtualWorld(npcid, worldid)
native GetRNPCVirtualWorld(npcid)

// vehicle controls
native PutRNPCInVehicle(npcid, vehicleid, seatid) // not working with 0.2.1 plugin
native RemoveRNPCFromVehicle(npcid) // not working with 0.2.1 plugin
native SetRNPCVehicleSiren(npcid,vstate)
native GetRNPCVehicleSiren(npcid)

// on foot controls
native SetRNPCSkin(npcid, skin)
native SetRNPCPos(npcid, Float:x, Float:y, Float:z)
native GetRNPCPos(npcid, &Float:x, &Float:y, &Float:z)
native MoveRNPC(npcid, Float:x, Float:y, Float:z, Float:speed) // taken from the original rnpc include
native SetRNPCFacingAngle(npcid, Float:angle)
native SetRNPCHealth(npcid, health) // remember the health value must be an integer and not working with 0.3 plugin
native GetRNPCHealth(npcid)
native SetRNPCArmour(npcid, armour) // remember the armour value must be an integer and not working with 0.3 plugin
native GetRNPCArmour(npcid)
native SetRNPCWeapon(npcid, weaponid)
native GetRNPCWeapon(npcid)
native SetRNPCSkillLevel(npcid, skill, level)

// npc actions
native RNPCWalkTo(npcid,Float:X,Float:Y,Float:Z);
native RNPCRunTo(npcid,Float:X,Float:Y,Float:Z);
native RNPCSprintTo(npcid,Float:X,Float:Y,Float:Z);
native RNPCAimAt(npcid,Float:X,Float:Y);
native RNPCShotAt(npcid,Float:X,Float:Y);
native RNPCStopUseWeapon(npcid);
native RNPCDriveTo(npcid,Float:X,Float:Y,Float:Z,Float:speed);
native RNPCFollowPlayer(npcid, targetid, movemode = RNPC_SPEED_SPRINT)

// .rec part
native RNPC_StartPlayback(npcid, rec[])
native RNPC_StopPlayback(npcid)
native RNPC_StartBuildPlayback(npcid, slot=0, vehicleid=0)

*/


Callbacks
forward OnRNPCCreated(npcid);
forward OnRNPCDestroyed(npcid);
forward OnRNPCSpawn(npcid);
forward OnRNPCPlaybackFinished(npcid); // it's usable but already called so DO NOT uncomment this
forward OnRNPCDeath(npcid);

Download
Click here to download 1.1 R2 Package (includes, RNPC Plugin 0.3.1, YSI package)
Click here to watch the gamemode tested with this include - pastebin. (GM edited as with 1.1R2 version

Bugs
PutRNPCInVehicle works only with driver sits.

Notes
  • IF YOU USE A TIMER WITH ANY FUNCTION KILL THEM BEFORE USING A NEW ONE!
  • THIS INCLUDE WAS TESTED ONLY WITH 0.3e and (not R2) and 0.3x SERVER.
  • THIS INCLUDE NEEDS y_hooks.
  • DO NOT USE RNPC PLUGIN BELOW 0.3 VERSION.
  • SOMETIMES THE NPCS MAY NOT BE SYNCED WELL.
  • THE GAMEMODE .pwn FILE REQUIRES EXTRA INCLUDES THAT THE PACKAGE DOESN'T INCLUDE.
  • PLEASE DO NOT REMOVE ANY CREDITS FROM THE INCLUDE.

Sserver Notes
  • Use "RemoveRNPCFromVehicle" if a NPC is in a car, before using another function.
  • When multiple npcs get connected the order of connection may be wrong
  • Since this include and the plugin either have not a damage system whatsoever I can't/ I have not time for a good one. You can take a look HERE.. - Thanks to [uL]Pottus


Credits
Me for the include
Mauzen for his RNPC Plugin and Joe Staff's code based.
****** for y_hooks.
__________________

Last edited by TheArcher; 17/10/2013 at 06:16 AM. Reason: Add informations about damage system
TheArcher is offline   Reply With Quote
Old 02/02/2013, 06:37 PM   #2
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: ARNPC - Advanced Recordfree NPC

Nice.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 02/02/2013, 06:38 PM   #3
T0pAz
Guest
 
Posts: n/a
Default Re: ARNPC - Advanced Recordfree NPC

Good work. Whenever I see the RNPC function, I mistook it with the RPC function on network(Remote Procedure Call).
  Reply With Quote
Old 03/02/2013, 12:48 PM   #4
tiernantheman
Huge Clucker
 
Join Date: Dec 2011
Location: United States
Posts: 397
Reputation: 66
Default Re: ARNPC - Advanced Recordfree NPC

Awesome release, just what I was looking for! Great job!!
tiernantheman is offline   Reply With Quote
Old 03/02/2013, 01:09 PM   #5
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default Re: ARNPC - Advanced Recordfree NPC

Nice.
Lordzy is offline   Reply With Quote
Old 04/02/2013, 01:17 AM   #6
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: ARNPC - Advanced Recordfree NPC

YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ......... THIS IS WHAT I BEEN WAITING FOR
Glad2BeHere is offline   Reply With Quote
Old 04/02/2013, 01:47 AM   #7
Kitten
High-roller
 
Join Date: Jul 2010
Location: United States
Posts: 2,169
Reputation: 345
Default Re: ARNPC - Advanced Recordfree NPC

Really useful i may be converting my functions to this.
Kitten is offline   Reply With Quote
Old 04/02/2013, 01:54 AM   #8
DrAke$
Little Clucker
 
DrAke$'s Avatar
 
Join Date: Jan 2006
Posts: 29
Reputation: 13
Default Re: ARNPC - Advanced Recordfree NPC

Nice
__________________
In Brief ...
DrAke$ is offline   Reply With Quote
Old 04/02/2013, 05:45 AM   #9
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,336
Reputation: 138
Default Re: ARNPC - Advanced Recordfree NPC

SuperB Script!
__________________
nope[IMG]http://*******/1r0SOkH_[/IMG]
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 04/02/2013, 05:50 AM   #10
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,793
Reputation: 1179
Default Re: ARNPC - Advanced Recordfree NPC

It's nice but I'd wait for Kalcor to introduce a revamped NPC system in the future than use the plugin. The CPU level with the plugin is unless you can memory edit the samp-server (which would need consent from sa-mp team) and make it not use the samp-npc.

Nice job anyway.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] RNPC - Recordfree NPCs | Control NPCs without recording | DEV Mauzen Plugin Development 974 08/08/2020 12:43 AM
Need some advanced help.. MatZZPL Scripting Help 3 30/08/2012 09:40 PM
[Map] Advanced Gym (RP) PixeledNinja Maps 19 27/09/2011 09:26 PM
[FilterScript] [FS] Advanced GPS Correlli Filterscripts 17 06/01/2010 07:55 PM


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.