08.11.2009, 20:22
After seeing Mo3's Intelligent NPCs and studying his scripts, it gave me a idea on how to make a NPC to follow me...
The problem is, The Animation of the Walk Walks a few steps forward then resets itself back to the base x,y,z where the NPC spawns..
Here is my script:
And the timer:
I've never done anything that uses animations...
Any ideas on what is causing the animation to keep repeating other than keep on going?
The problem is, The Animation of the Walk Walks a few steps forward then resets itself back to the base x,y,z where the NPC spawns..
Here is my script:
pawn Код:
public OnPlayerText(playerid, text[])
{
new JackID = GetPlayerID("Jack");
new Float:x,Float:y,Float:z;
GetPlayerPos(JackID,x,y,z);
if(IsPlayerFacingPlayer(playerid,JackID,10.0))
{
if(strfind(text, "Follow me") != -1 && IsPlayerInRangeOfPoint(playerid,5.0,x,y,z))
{
SetPlayerChatBubble(JackID,"Ok!",white, 100.0, 5000);
SetTimerEx("GetJackToFolow",100,1,"i",playerid);
ApplyAnimation(JackID,"PED","WALK_PLAYER",4.1,1,1,1,1,0);
return 1;
}
}
return 1;
}
pawn Код:
forward GetJackToFolow(playerid);
public GetJackToFolow(playerid)
{
new JackID = GetPlayerID("Jack");
SetPlayerFacingPlayer(JackID, playerid);
}
Any ideas on what is causing the animation to keep repeating other than keep on going?

