SA-MP Forums Archive
Bot animation - 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)
+--- Thread: Bot animation (/showthread.php?tid=331613)



Bot animation - Tomer!.$ - 05.04.2012

How can I set a bot to do animation? ApplyAnimation didn't work for me.
The script I did:
PHP код:
public OnPlayerSpawn(playerid)
{
    if(
IsPlayerNPC(playerid))
    {
        
SetPlayerSkin(playerid28);
        
SetPlayerPos(playerid2084.8064,-1582.5946,13.4408); // Bot);
        
SetPlayerFacingAngle(playerid336.4998);
        
ApplyAnimation(playerid"DEALER""DEALER_IDLE"4.1011101);
        new 
Text3D:label Create3DTextLabel("Wanna get some coke nigga?"COLOR_BLUE30.040.050.040.00);
        
Attach3DTextLabelToPlayer(labelplayerid0.00.00.1);
    }
    else
    {
        
SetPlayerPos(playerid2084.8809,-1565.4945,13.3551);
        
SetPlayerColor(playerid0xFFFFFF00);
        
GivePlayerMoney(playerid10000);
    }
    return 
1;




Re: Bot animation - Ezay - 05.04.2012

I Beleave you can Record the Animation if you Make a Command in your Script.
Then Record it With your ((/rcon loadfs npc_record)).
I'm Sure it Works


Cheers
Ezay
\o/


Re: Bot animation - Tomer!.$ - 05.04.2012

I know that I can do that.. I am seeking for any way to do this with a function instead.


Re: Bot animation - blank. - 05.04.2012

You have to record it manually as fair as I know and run it using
https://sampwiki.blast.hk/wiki/NPC:StartRecordingPlayback
https://sampwiki.blast.hk/wiki/NPC:StopRecordingPlayback


Re: Bot animation - Catalyst- - 05.04.2012

pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(IsPlayerNPC(playerid))
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        if(!strcmp(name, "NPC_NAME", false)) // Change NPC_NAME to the name of your NPC
        {
            ApplyAnimation(playerid, "DEALER", "DEALER_IDLE",  4.1, 0, 1, 1, 1, 0, 1);
        }
    }
    return 1;
}
EDIT: Sorry, I wasn't thinking, there's no need for a loop. This should be a lot better.


Re: Bot animation - Tomer!.$ - 05.04.2012

Thanks, working.