Bot animation
#1

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;

Reply
#2

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

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

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

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

Thanks, working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)