30.03.2015, 20:30
You can do this easily:
If you don't like OnPlayerUpdate, use a timer..with ~150ms
PHP код:
new bool:aCheck[MAX_PLAYERS char],aIDX[MAX_PLAYERS];
//Under OnPlayerUpdate
switch(aCheck{playerid}) {
case true: {
if(!GetPlayerAnimationIndex(playerid)) OnPlayerAnimationEnd(playerid,aIDX[playerid]),aCheck{playerid}=false;
}
case false: {
if(GetPlayerAnimationIndex(playerid)) {
aCheck{playerid} = true;
aIDX[playerid] = GetPlayerAnimationIndex(playerid);
}
}
}
//In the Script:
stock OnPlayerAnimationEnd(playerid, idx)
{
new animlib[32],animname[32],msg[128];
GetAnimationName(idx,animlib,32,animname,32);
format(msg, 128, "Anim ended: %s %s", animlib, animname);
SendClientMessage(playerid, 0xFFFFFFFF, msg);
return 1;
}