Can you teleport (SetPlayerPos) an NPC?
#1

So let's say I record an npc walking in a fairly large circle somewhere in los santos. I know you can set it's position somewhere else but... if you do will it continue to walk in that circle where you put it at? Or will it teleport back to where you recorded it to and continue to loop.

Reason I want to know is b/c I want to make a /airsupport command where an NPC in a big plane flies around you, regardless of your location. On that notice... what happens if it hits a building looool?
Reply
#2

SetPlayerPos (and all other player functions) wont affect NPC's, use https://sampwiki.blast.hk/wiki/NPC:SetMyPos instead.
See: https://sampwiki.blast.hk/wiki/Category:NPC for more NPC functions

I've never used the NPC myself, but it shouldn't be too much to test it yourself and see what happens.
Reply
#3

I could test it myself... or I could see if anyone who has ever tried it has done it before
Reply
#4

You'll be lucky if anyone answers. Laziness won't motivate anyone to help you :P
Reply
#5

Your lucky!

I figured out that a non recorded npc can easy be teleported with setplayerpos.

i tested this the following way;

making an npc without the recording
then under onplayerspawn (the part where the npc is spawned) put SetPlayerPos)
The npc will spawn at the point you want it.

After you have done that you can still use setplayerpos...put it in a command the npc could use or something.

Note: This will not work with npc's in a vehicle
Reply
#6

Not lucky

He asked if an NPC that plays back a recording will continue to act relative to a location it is moved to, or 'teleport' back to the exact spot where that actions were recorded and carry on its jolly way.

Almost :P
Reply
#7

Ow i see my bad XD well to bad for him then
Reply
#8

My life sucks..
Reply
#9

Quote:
Originally Posted by VictorMartinez
My life sucks..
LMAO

no man XD npc's suck in some ways but theres alot more fun that you can do with them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)