ziggi / FCNPC

FCNPC - Fully Controllable NPC
Apache License 2.0
138 stars 31 forks source link

An FCNPC shooting another FCNPC #151

Closed Sasino97 closed 5 years ago

Sasino97 commented 6 years ago

Using FCNPC_AimAt with shoot=true, with another FCNPC as target, the bullet will reach the target NPC no matter what is in between.

http://forum.sa-mp.com/showthread.php?p=4016722&posted=1#post4016722

NegativeIQ commented 6 years ago

Thats the way its supposed to be, there is no ColAndreas to check if there is anything in between. And if there was ColAndreas you still would not be able to detect vehicles and players (basically any dynamic entity)

WoutProvost commented 6 years ago

The function handling the shooting is this one.

NegativeIQ commented 6 years ago

@WoutProvost yeah you are right, but still it will be pretty inaccurate (like everything in samp) since animations and bones positions are not taken into account, not to mention lag. Its not FCNP's fault its just limits of samp and reason why many people left it, including me.

WoutProvost commented 6 years ago

Yes, it's not perfect indeed.

On the topic of that shoot function btw, there are some things that are not taken into account. I'll fix that later.

WoutProvost commented 6 years ago

I'll answer the topic discussed in the original post.

The reason players don't take damage is because the player damage system is handled by SA-MP and not the plugin. The NPC shoots at the player, SA-MP detects that there is something in between, so the player doesn't receive damage.

The reason NPCs do take damage is because the NPC damage system is handled by the plugin and not SA-MP. The NPC shoots at the other NPC, the plugin can't (fully) check if there is something in between, so the NPC does receive damage.

WoutProvost commented 6 years ago

I'm working on some code to slightly improve the shooting mechanics. I'll create a pull request when it is finished.