FCNPC related questions. - 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)
+--- Thread: FCNPC related questions. (
/showthread.php?tid=629529)
FCNPC related questions. - iLearner - 28.02.2017
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:fPointX, Float:fPointY, Float:fDestX, Float:fDestY)
return absoluteangle(-(90-(atan2((fDestY - fPointY), (fDestX - fPointX)))));
Re: FCNPC related questions. -
DRIFT_HUNTER - 28.02.2017
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