24.08.2010, 14:55
А зачем их определять самому если можно отслеживать их изменение:
pawn Code:
new animOld[MAX_PLAYERS];
forward OnPlayerAnimationChange(playerid,newanim[],oldanim[]);
public OnPlayerAnimationChange(playerid,newanim[],oldanim[])
{
new string[128];
format(string,128,"newanim = %s,oldanim = %s",newanim,oldanim);
SendClientMessage(playerid,0x00ff00ff,string);
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerAnimationIndex(playerid) && IsPlayerAdmin(playerid))
{
new animNew[32], animlib[32];
GetAnimationName(GetPlayerAnimationIndex(playerid) ,animlib,32,animNew,32);
if(strcmp(animOld[playerid],animNew, false) != 0)
{
CallRemoteFunction("OnPlayerAnimationChange","dss",playerid,animNew,animOld[playerid]);
}
strmid(animOld[playerid],animNew,0,strlen(animNew),32);
}
return 1;
}