SA-MP Forums Archive
Suggestions how to do this and work with NPCs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Suggestions how to do this and work with NPCs (/showthread.php?tid=601110)



Suggestions how to do this and work with NPCs - Type-R - 16.02.2016

Hi, guys well today i came up with an idea that i would want to interpret in my server, but i have a hard time visualizing on how to do it. Here what i would like to do: I would like to, be able to go into a checkpoint holding a box, then to be frozen and an NPC would spawn, come by the checkpoint, grab the box and leave, shortly after disappearing. I am having a hard time with the NPC part, because i am not familiar with them. I know i could record an NPC and spawn it when in checkpoint, but how could i make it grab the box? And then after it grabbing the box, i could make it disappear when the recording stops. Any suggestions on how to do this? Thank you.


Re: Suggestions how to do this and work with NPCs - Chilli9434 - 16.02.2016

https://sampwiki.blast.hk/wiki/ApplyAnimation - This works with NPCs, and you would probably want to use timers to get the NPC to walk, then apply the animation, attach object and leave.

Also, ApplyAnimation(player, "MISC", "pickup_box", 4, 0, 0, 0, 0) is an animation to pickup a box.

Cant do much if you dont have any code to show, but I hope this helps


Re: Suggestions how to do this and work with NPCs - Type-R - 16.02.2016

Thanks it definitely helps. I was also looking at this plugin: https://sampforum.blast.hk/showthread.php?tid=428066. I found out that it is not possible to make recorded NPCs do animations. Is this true? and what do you think about using the plugin? And if i needed these NPC for many different houses(want them to pickup the mail, that players would drive to houses.) would i need to keep on disconnecting and reconnecting them?