SA-MP Forums Archive
Apllying animations on NPC. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Apllying animations on NPC. (/showthread.php?tid=261864)



Apllying animations on NPC. - dEzIRE - 15.06.2011

Hello,

I'm trying to apply animations on NPC but I got a little "BUG".
Here is what i've tried to do:
if(IsPlayerNPC(playerid))
{
GetPlayerName(playerid,playername,64);
if(strfind(playername, "[F]",false) != -1)
{
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1 ,1,1,1);
}
}
It's just not applying the animation, the NPC is doing nothing.
What should I do and what's the problem here?

Thanks a lot.


Re: Apllying animations on NPC. - Calgon - 15.06.2011

Which callback is that code placed in? You might not have placed it in a callback where the player has had a chance to spawn, which would result in the animation not synchronizing properly.


Re: Apllying animations on NPC. - Sasino97 - 15.06.2011

Quote:
Originally Posted by dEzIRE
Посмотреть сообщение
Hello,

I'm trying to apply animations on NPC but I got a little "BUG".
Here is what i've tried to do:
if(IsPlayerNPC(playerid))
{
GetPlayerName(playerid,playername,64);
if(strfind(playername, "[F]",false) != -1)
{
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1 ,1,1,1);
}
}
It's just not applying the animation, the NPC is doing nothing.
What should I do and what's the problem here?

Thanks a lot.
The same identic thing, but I use CNPC.


Re: Apllying animations on NPC. - dEzIRE - 15.06.2011

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
Which callback is that code placed in? You might not have placed it in a callback where the player has had a chance to spawn, which would result in the animation not synchronizing properly.
on player spawn


Re: Apllying animations on NPC. - dEzIRE - 16.06.2011

bump