GetPlayerAnimationFlags
warning
This function was added in omp v1.1.0.2612 and will not work in earlier versions!
Description
Get the player animation flags.
Name | Description |
---|---|
playerid | The player id you want to get the animation flags from |
Returns
Returns the player animation flags as an integer.
Examples
In order to get each flag separately, bit masking is used.
#define ANIM_FREEZE_FLAG 0b0000000000000100
#define ANIM_LOCK_X_FLAG 0b0010000000000
#define ANIM_LOCK_Y_FLAG 0b0001000000000
#define ANIM_LOOP_FLAG 0b0000100000000
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/myanimflags"))
{
new messageString[128];
new flags = GetPlayerAnimationFlags(playerid);
new bool:freeze = (flags & ANIM_FREEZE_FLAG) != 0 ? true : false;
new bool:lockx = (flags & ANIM_LOCK_X_FLAG) != 0 ? true : false;
new bool:locky = (flags & ANIM_LOCK_Y_FLAG) != 0 ? true : false;
new bool:loop = (flags & ANIM_LOOP_FLAG) != 0 ? true : false;
format(messageString, sizeof(messageString), "Your anim flags are: [freeze:%i] [lockx:%i] [locky:%i] [loop:%i]", freeze, lockx, locky, loop);
SendClientMessage(playerid, -1, messageString);
return 1;
}
return 0;
}
Notes
warning
If the player state is not on-foot, all returned animation flags are 0.
Related Functions
- ApplyAnimation: Apply an animation to a player.