11.08.2011, 13:19
I tried to make an NPC apply the running animation. It is running but it stays in the same place, I can see it running but it's like it's frozen.
pawn Code:
public SyncNPC()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
for(new npc=0; npc<MAX_PLAYERS; npc++)
{
if(IsPlayerNPC(npc))
{
new Float:Xnpc, Float:Ynpc, Float:Znpc;
GetPlayerPos(npc, Xnpc, Ynpc, Znpc);
if(IsPlayerInRangeOfPoint(i, 150.0, Xnpc, Ynpc, Znpc))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(npc, npcname, sizeof(npcname));
if(!strcmp(npcname, "Jimmeh", true))
{
new stringnpc[256];
format(stringnpc, sizeof(stringnpc), "{ee5555}Jimmeh says: {FFFFFF}Test!");
ProxDetector(30.0, i, stringnpc, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:Xplaya, Float:Yplaya, Float:Zplaya;
GetPlayerPos(i, Xplaya, Yplaya, Zplaya);
ApplyAnimation(npc,"ped","null",0.0,0,0,0,0,0);
SetPlayerLookAt(npc,Xplaya, Yplaya);
ApplyAnimation(npc,"ped","run_player", 4.1, 1, 1, 1, 1, 0);
TogglePlayerControllable(npc, 1);
//ApplyAnimation(playerid,"ped","WALK_player", 4.1, 1, 1, 1, 0, 0);
}
}
}
}
}
}
}