SA-MP Forums Archive
Animations - 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: Animations (/showthread.php?tid=513661)



Animations - Dziugsas - 17.05.2014

Hello guys.

Why any animations aren't playing?

PHP Code:
new Length strlen(text);
    new 
aTime Length*200;
    new 
name[MAX_PLAYER_NAME],string[150],Float:X,Float:Y,Float:Z;
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerPos(playeridXYZ);
    
format(stringsizeof(string), ""TCWHITE"["TCRED"%s"TCRED"]: "TCCYAN"%s"nametext[0]);
    
strreplace(name'_'' ');
    for(new 
0MAX_PLAYERS; ++i)
    {
        if(
IsPlayerInRangeOfPoint(i5XYZ))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 1)
            {
                
SetPlayerChatBubble(playeridtextCOL_ADMINGREEN50.04000);
                
SendClientMessage(i,COL_ADMINGREEN,string);
                if(!
IsPlayerInAnyVehicle(playerid))
                {
                    
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0,aTime);
                }
                else
                {
                    
ApplyAnimation(playerid,"PED","car_talkm_in ",4.1,1,1,1,0,aTime);
                }
                return 
1;
            }
            else if(
PlayerInfo[playerid][pAdmin] == 0)
            {
                
SetPlayerChatBubble(playeridtextCOL_WHITE50.04000);
                
SendClientMessage(i,COL_WHITE,string);
                if(!
IsPlayerInAnyVehicle(playerid))
                {
                    
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0,aTime);
                }
                else
                {
                    
ApplyAnimation(playerid,"PED","car_talkm_in ",4.1,1,1,1,0,aTime);
                }
                return 
1;
            }
        }
    } 



Re: Animations - Spartaaaaa - 17.05.2014

pawn Code:
new Length = strlen(text);
    new aTime = Length*200;
    new name[MAX_PLAYER_NAME],string[150],Float:X,Float:Y,Float:Z;
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerPos(playerid, X, Y, Z);
    format(string, sizeof(string), ""TCWHITE"["TCRED"%s"TCRED"]: "TCCYAN"%s", name, text[0]);
    strreplace(name, '_', ' ');
    for(new i = 0; i < MAX_PLAYERS; ++i)
    {
        if(IsPlayerInRangeOfPoint(i, 5, X, Y, Z))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                SetPlayerChatBubble(playerid, text, COL_ADMINGREEN, 50.0, 4000);
                SendClientMessage(i,COL_ADMINGREEN,string);
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0,aTime);
                }
                else
                {
                    ApplyAnimation(playerid,"PED","car_talkm_in ",4.1,1,1,1,0,aTime);
                }
                return 1;
            }
            else if(PlayerInfo[playerid][pAdmin] == 0)
            {
                SetPlayerChatBubble(playerid, text, COL_WHITE, 50.0, 4000);
                SendClientMessage(i,COL_WHITE,string);
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0,aTime);
                }
                else
                {
                    ApplyAnimation(playerid,"PED","car_talkm_in ",4.1,1,1,1,0,aTime);
                }
                return 0;
            }
        }
    }



Re: Animations - Dziugsas - 17.05.2014

Nothing have changed...same.


Re : Animations - yusei - 17.05.2014

You have to apply nearly every animation twice before it works

the following

PHP Code:
stock ApplyPlayerAnimation(playeridanimlib[], animname[], Float:fDeltalooplockxlockyfreezetimeforcesync 0)
{
    
ApplyAnimation(playeridanimlib"null"fDeltalooplockxlockyfreezetimeforcesync); // Pre-load animation library
    
return ApplyAnimation(playeridanimlibanimnamefDeltalooplockxlockyfreezetimeforcesync);

Use ApplyPlayerAnimation instead of ApplyAnimation.

PS : this is not mine ^^ but i use it and it work perfectly


Re: Animations - Dziugsas - 17.05.2014

Sorry , still not working ,yusei.


Re: Animations - Dziugsas - 17.05.2014

Tried to preloadanimlib , still not working.What the hell?


Re: Animations - Rittik - 17.05.2014

Try freezing the player.


Re: Animations - Dziugsas - 17.05.2014

I don't want him to freeze , instead , i want him to make animation while runing.And animation when chatting in a car.


Re: Animations - Dziugsas - 18.05.2014

BUMP