[v_NPC v1.1.4] Easy NPC Controlling! -
corne - 13.01.2012
Installation:
1. Download the Include.
2. Place it into your "
Pawno > Include" folder.
3. Add "
#include <a_npc>" and "
#include <v_NPC>" above your script.
4. Add "
vNPC_OnPlayerConnect(playerid);" at the top of OnPlayerConnect.
5. Add "
vNPC_OnPlayerSpawn(playerid);" at the top of OnPlayerSpawn.
6. Use it! For more information about using it check the example code.
Functions:
pawn Код:
vNPC_CreateNPC(name[MAX_PLAYER_NAME], script[32], skinid, bool:usecolor, color = -1, vehmodelid = -1, vehcolor1 = 1, vehcolor2 = 1); // Returns the ID of the NPC.
//name[MAX_PLAYER_NAME] : The ingame name of the NPC.
//script[32] : The name of the script in your npcmodes folder.
//skinid : The ID of the skin the NPC has to wear.
//bool:usecolor : If you want to show the NPC's blimp or not.
//color = -1 : If above is set to true, set this to the color the NPC's blimp has to be. (Optional)
//vehmodelid = -1 : If the NPC is recorded in a car add the model of the vehicle here. (Optional)
//vehcolor1 = 1 : If the NPC is recorded in a car add the first vehicle color here. (Optional)
//vehcolor2 = 1 : If the NPC is recorded in a car add the second vehicle color here. (Optional)
vNPC_ConnectNPC(npcid); // Returns nothing.
//npcid : The ID that was returned at vNPC_CreateNPC.
vNPC_DisconnectNPC(npcid); // Returns nothing.
//npcid : The ID that was returned at vNPC_CreateNPC.
Downloads:
Pastebin (v1.1.4):
-
Include
-
Example Script
Additional Information:
Remember that this is still the beta version, it has been tested and worked fine.
Please report any bugs, suggestions for the future are also welcome.
If you want to use more then 50 NPC's then you have to change MAX_VNPCS in the include to the amount you want to use.
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Kaperstone - 13.01.2012
looks very nice

will try someday....
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
SpiderWalk - 13.01.2012
NICEEE!!
Respuesta: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Jovanny - 13.01.2012
It would be good to add a function to walk to X, Y, Z using animations, IsPlayerInRangeOfPoint, SetPlayerFacingAngle for better control of the "NPC"
Re: Respuesta: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
corne - 13.01.2012
Quote:
Originally Posted by Jovanny
It would be good to add a function to walk to X, Y, Z using animations, IsPlayerInRangeOfPoint, SetPlayerFacingAngle for better control of the "NPC"
|
Im gonna try to make those functions in the future. Anyway, thank you guys for the positive reactions!
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Kaperstone - 13.01.2012
can you make those NPC's kill-able and make them shoot?
that would be awesome if yes
Respuesta: Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Jovanny - 13.01.2012
Quote:
Originally Posted by xkirill
can you make those NPC's kill-able and make them shoot?
that would be awesome if yes 
|
There are animations for shooting, but do not work with all weapons
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
corne - 13.01.2012
It would be possible with animations, 0.3c Particle Objects (to make it look like the gun is shooting).
I will attempt to make that once in the future.
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
[DOG]irinel1996 - 13.01.2012
Looks nice, hihi...
Now it's easier create NPCs for begginers.

5/5
Re: Respuesta: Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Kaperstone - 13.01.2012
Quote:
Originally Posted by Jovanny
There are animations for shooting, but do not work with all weapons
|
yea,but would be better if it will really hurt/damage players,no?
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
corne - 13.01.2012
Quote:
Originally Posted by Jovanny
It would be good to add a function to walk to X, Y, Z using animations, IsPlayerInRangeOfPoint, SetPlayerFacingAngle for better control of the "NPC"
|
I just noticed SetPlayerFacingAngle already exists.
More information about it here:
https://sampwiki.blast.hk/wiki/NPC:SetMyFacingAngle.
EDIT: I started with developing the next version which will have the abillity to let the NPC's walk, swim or run to positions.
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
rbN. - 14.01.2012
Quote:
Originally Posted by corne
EDIT: I started with developing the next version which will have the abillity to let the NPC's walk, swim or run to positions.
|
Does it lagg? D:
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] - T0pAz - 14.01.2012
Does it decreases max amount of players?
Does it lags?
Does it opens a process for each npc's?
Does it syncs properly?
Does it works without recording?
Anyways nice work!
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Lorenc_ - 14.01.2012
I don't see how this is interesting... I've made a cnpc include and so did erocun. 3 functions, that's all?
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
corne - 14.01.2012
Quote:
Originally Posted by T0pAz
Does it decreases max amount of players?
Does it lags?
Does it opens a process for each npc's?
Does it syncs properly?
Does it works without recording?
Anyways nice work!
|
Ofcourse it decreases the max amount of players and opens a process for each npc.
Currently it only makes it easier to add recorded NPC's, im currently working on another version which allows creating npcs without recording. About the syncing and lagg i can't say anything yet, as im not so far with the new version yet.
Quote:
Originally Posted by Lorenc_
I don't see how this is interesting... I've made a cnpc include and so did erocun. 3 functions, that's all?
|
Maybe there are only 3 functions becouse this is still the beta?
Re: [v_NPC v1.1.4] Easy NPC Controlling! [BETA] -
Lorenc_ - 14.01.2012
Quote:
Originally Posted by corne
Ofcourse it decreases the max amount of players and opens a process for each npc.
Currently it only makes it easier to add recorded NPC's, im currently working on another version which allows creating npcs without recording. About the syncing and lagg i can't say anything yet, as im not so far with the new version yet.
Maybe there are only 3 functions becouse this is still the beta?
|
Why would you call this a beta when you already know that the functions are going to work properly?
Btw, considering that you're going to make support for other things, I though I could let you know if you could perhaps get some ideas from my npc include.
https://sampforum.blast.hk/showthread.php?tid=301370
I could develop some more stuff to it but cbf..