HELP: NPC follow Player using FCNPC. - 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: HELP: NPC follow Player using FCNPC. (
/showthread.php?tid=660661)
HELP: NPC follow Player using FCNPC. -
bookknp - 09.11.2018
hello friends, I'm trying to get an npc to follow a player using FCNPC but I'm new and I do not know if I'm doing something wrong ... the npc does not follow the player, why is this happening? what is the way the NPC follow the player?
PHP код:
public OnGameModeInit()
bot1 = FCNPC_Create("Officerino");
printf("Officerino: %i", bot1);
public Follower(playerid)
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
FCNPC_GoTo(bot1, x, y, z, MOVE_TYPE_SPRINT, .UseMapAndreas = true);
FCNPC_GoToPlayer(bot1, playerid);
Re: HELP: NPC follow Player using FCNPC. -
Freaksken - 09.11.2018
Don't use both functions at the same time.
FCNPC_GoTo:
NPC goes to a point and then stops moving.
FCNPC_GoToPlayer:
NPC goes to a player and keeps following that player, even when that player moves, until it reaches the player and then stops moving.
Re: HELP: NPC follow Player using FCNPC. -
bookknp - 09.11.2018
Quote:
Originally Posted by Freaksken
Don't use both functions at the same time.
FCNPC_GoTo:
NPC goes to a point and then stops moving.
FCNPC_GoToPlayer:
NPC goes to a player and keeps following that player, even when that player moves, until it reaches the player and then stops moving.
|
Very thx friend!!! Now, I have a problem. When I teleport to see the npc in a position it runs out to the position I've spawned, why does this happen?
PHP код:
public Follower(playerid)
FCNPC_GoToPlayer(bot1, playerid, FCNPC_MOVE_TYPE_AUTO, FCNPC_MOVE_TYPE_AUTO, false, 0.0, true, 0.0, 1.5, 250);
Re: HELP: NPC follow Player using FCNPC. -
bookknp - 09.11.2018
Quote:
Originally Posted by bookknp
Very thx friend!!! Now, I have a problem. When I teleport to see the npc in a position it runs out to the position I've spawned, why does this happen?
PHP код:
public Follower(playerid)
FCNPC_GoToPlayer(bot1, playerid, FCNPC_MOVE_TYPE_AUTO, FCNPC_MOVE_TYPE_AUTO, false, 0.0, true, 0.0, 1.5, 250);
|
solve it

thx Freaksken