animation for NPC (+ rep)
#5

This wouldn't work

An easy way is to load npcidle.amx for your bot, then add this in your gamemode:

pawn Код:
new NPCid = INVALID_PLAYERID;
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
NPCid = playerid;
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/npccrossarms", cmdtext, true) == 0) {
if(NPCid == INVALID_PLAYERID)
{
return SendClientMessage(playerid, -1, "NPC is not connected!");
}
else
{
ApplyAnimation(NPCid, "DEALER", "DEALER_IDLE", 4.0, 0, 1, 1, 1, -1); // Arms crossed 2
SendClientMessage(playerid, -1, "Command sent to NPC");
return 1;
}
}
That should do the trick, also make sure you load npcidle.amx for your bot, or else it won't do any animations.
Reply


Messages In This Thread
animation for NPC (+ rep) - by WardenCS - 28.02.2012, 14:09
Re: animation for NPC (+ rep) - by WardenCS - 29.02.2012, 13:35
Re: animation for NPC (+ rep) - by WardenCS - 01.03.2012, 10:55
Re: animation for NPC (+ rep) - by WardenCS - 03.03.2012, 05:55
Re: animation for NPC (+ rep) - by DeathTone - 03.03.2012, 06:36

Forum Jump:


Users browsing this thread: 1 Guest(s)