28.02.2017, 07:03
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.
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)))));