SA-MP Forums Archive
NPC animation doesn't work - Help! - 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: NPC animation doesn't work - Help! (/showthread.php?tid=199988)



NPC animation doesn't work - Help! - VonKnox - 17.12.2010

Ok so for some reason the NPC SHOULD be looping through the drunk walk animation, however it is not doing the animation at all. (This is just a blank NPC it does not use a recording nor do I want it to use a recording). I am aware that this animation will not make the NPC move I just want it to be applied when it spawns (I'm geussing the NPC will just drunk walk on the spot or something).

All I want is the NPC to do the animation when it spawns, which is not happening for some odd reason.

Код:
public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
	{
	ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
	}
    return 1;
}
(NOTE: I have searched and found similar topics having the same problem - however I did not find a solution.)


Thanks in advance.


Re: NPC animation doesn't work - Help! - Mehtab - 17.12.2010

use NPC generator


Re: NPC animation doesn't work - Help! - VonKnox - 17.12.2010

Quote:
Originally Posted by Mehtab
Посмотреть сообщение
use NPC generator
Where do I find this?


Re: NPC animation doesn't work - Help! - Mehtab - 17.12.2010

next time ****** it. CLICKHERE


Re: NPC animation doesn't work - Help! - Rachael - 17.12.2010

I think if you preload animations before applying them while recording your NPC will do the animation
pawn Код:
ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0,1);
animlib is a string containing the animation library you wish to preload


Re: NPC animation doesn't work - Help! - VonKnox - 17.12.2010

Quote:
Originally Posted by Rachael
Посмотреть сообщение
I think if you preload animations before applying them while recording your NPC will do the animation
pawn Код:
ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0,1);
animlib is a string containing the animation library you wish to preload
This didn't work.


Trying Mehtab's suggestion now, will edit this post with the results.


[EDIT: I'm not sure I understand what good that NPC creator would do, it just looks like an easier way to give your NPC a skin and weapon, how does this help me make it do an animation?]


Re: NPC animation doesn't work - Help! - VonKnox - 18.12.2010

Still no solution?

I thought it wouldn't have been this hard to make an NPC to an animation (it doesn't have to be the drunk walk it could be anything at all) - I'm planning on coding the NPC to move while doing a walking animation, but first I have to try and get the NPC to do the animation....

Anyone got ideas on how to make this work? (Or a working peice of code..)