SA-MP Forums Archive
controllable npc question wtih playerid stuff :D - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: controllable npc question wtih playerid stuff :D (/showthread.php?tid=182224)



controllable npc question wtih playerid stuff :D - WillyP - 09.10.2010

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


Re: controllable npc question wtih playerid stuff :D - Mauzen - 10.10.2010

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.


Re: controllable npc question wtih playerid stuff :D - Matite - 10.10.2010

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.


Re: controllable npc question wtih playerid stuff :D - WillyP - 10.10.2010

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