[Include] [v_NPC v1.1.4] Easy NPC Controlling! [BETA]
#1

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.
Reply
#2

looks very nice
will try someday....
Reply
#3

NICEEE!!
Reply
#4

It would be good to add a function to walk to X, Y, Z using animations, IsPlayerInRangeOfPoint, SetPlayerFacingAngle for better control of the "NPC"
Reply
#5

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!
Reply
#6

can you make those NPC's kill-able and make them shoot?
that would be awesome if yes
Reply
#7

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
Reply
#8

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.
Reply
#9

Looks nice, hihi...
Now it's easier create NPCs for begginers.
5/5
Reply
#10

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?
Reply
#11

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.
Reply
#12

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:
Reply
#13

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!
Reply
#14

I don't see how this is interesting... I've made a cnpc include and so did erocun. 3 functions, that's all?
Reply
#15

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?
Reply
#16

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..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)