Apllying animations on NPC.
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

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
Reply
#5

bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)