PDA

View Full Version : Animations


Dziugsas
17/05/2014, 02:10 PM
Hello guys.

Why any animations aren't playing?

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 1;
}
}
}

Spartaaaaa
17/05/2014, 02:18 PM
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;
}
}
}

Dziugsas
17/05/2014, 02:32 PM
Nothing have changed...same.

yusei
17/05/2014, 02:42 PM
You have to apply nearly every animation twice before it works

the following

stock ApplyPlayerAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}

Use ApplyPlayerAnimation instead of ApplyAnimation.

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

Dziugsas
17/05/2014, 02:46 PM
Sorry , still not working ,yusei.

Dziugsas
17/05/2014, 03:04 PM
Tried to preloadanimlib , still not working.What the hell?

Rittik
17/05/2014, 03:11 PM
Try freezing the player.

Dziugsas
17/05/2014, 03:16 PM
I don't want him to freeze , instead , i want him to make animation while runing.And animation when chatting in a car.

Dziugsas
18/05/2014, 12:05 PM
BUMP