controllable npc question wtih playerid stuff :D
#1

https://sampforum.blast.hk/showthread.php?tid=174671

i thought of

onplayerupdate

new float (playerpos)
native SetNPCVehiclePos(npcid,Float:X,Float:Y,Float:Z);

but then that would make the car jump all the time..

not a car actually following and shooting at the person..

a example of how i should do it? xd
Reply
#2

Maybe the pos you set the car to is a bit too low or too high, so that it sticks in the ground and jumps out.
Reply
#3

You could adapt this code:
http://www.gamerxserver.com/downloads/CNPC/citizens.pwn

All working files:
http://www.gamerxserver.com/downloads/CNPC

I just released it yesterday. I do not have time to work on CNPCs anymore.

Yes, my code is a bit messy. I normally clean it up (eg convert commands etc) after I finish with my "idea". However it is well commented so you can understand things.

There are some serious limitations of the CNPC bots:
* There is no way to get the width of a vehicles node path since that information is stored within the NAVI nodes: this means I cannot get them to drive in the correct lane.
* They do not work reliably on a linux server (maybe someone fixed this, I tried but failed).
* They will not work in any future version of SA:MP (someone will need to update it to work again).

Anyway, I totally loved playing with the bots in my test server (fyi, I'm closing the test server down but not the normal GamerX ofc).

Enjoy.
Reply
#4

Quote:
Originally Posted by Matite
Посмотреть сообщение
You could adapt this code:
http://www.gamerxserver.com/downloads/CNPC/citizens.pwn

All working files:
http://www.gamerxserver.com/downloads/CNPC

I just released it yesterday. I do not have time to work on CNPCs anymore.

Yes, my code is a bit messy. I normally clean it up (eg convert commands etc) after I finish with my "idea". However it is well commented so you can understand things.

There are some serious limitations of the CNPC bots:
* There is no way to get the width of a vehicles node path since that information is stored within the NAVI nodes: this means I cannot get them to drive in the correct lane.
* They do not work reliably on a linux server (maybe someone fixed this, I tried but failed).
* They will not work in any future version of SA:MP (someone will need to update it to work again).

Anyway, I totally loved playing with the bots in my test server (fyi, I'm closing the test server down but not the normal GamerX ofc).

Enjoy.
Thanks alot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)