FCNPC related questions.
#1

Hey,

I am using fcnpc for a game that I am creating... A minigame actually.

I have some questions, let's start off with the easier one:

How can I generate a random number among the one I choose, eg I wanted to get a random number among these: 7 15 26 19, is there a function that can do it? I've done it using array & it works but I was wondering if there was a pre-made function.

Second question is, can NPC's (with FCNPC) shot & damage player? If so how.

My third question is, I am using the the function from huth guy to get angle from point to point, but when the NPCs are near the player & try to hit, they just turn round And keep punching or turn to 90°, rarely hit the player.
PHP код:
stock Float:GetAngleToPoint(Float:fPointXFloat:fPointYFloat:fDestXFloat:fDestY)
    return 
absoluteangle(-(90-(atan2((fDestY fPointY), (fDestX fPointX))))); 
Reply
#2

1. Nope, you can just fill array and use random(int); function to chose random cell from that array.

2.
pawn Код:
FCNPC_AimAt(npcid, Float:x, Float:y, Float:z, bool:shoot = false, shoot_delay = 0, bool:setangle = true)
3. That thing when NPC turns his back to player when he is to close is a known bug. https://github.com/ziggi/FCNPC/issues/48
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)