Animations on chat
#1

Hey.

I have the talk animations to the onplayertext, and it works fine so far.

However, I was wondering. How am I able to prevent the animations from activating if: Another animation is active, the player is crouched, and if the player is frozen?

Here's the code.

Код:
new AnimR = random(1);
	if(AnimR == 0 && !IsPlayerInAnyVehicle(playerid))
	{
    ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 1, 0, 0, 1, 1);
    SetTimerEx("SpeakAnim", strlen(text)*150, false, "i", playerid);
	}
	else if(AnimR == 1 && !IsPlayerInAnyVehicle(playerid))
	{
    ApplyAnimation(playerid, "PED", "Idle_Chat_02", 4.0, 1, 0, 0, 1, 1);
    SetTimerEx("SpeakAnim", strlen(text)*150, false, "i", playerid);
	}
Reply
#2

If statements, now crouching is easy
https://sampwiki.blast.hk/wiki/GetPlayerSpecialAction
https://sampwiki.blast.hk/wiki/SpecialActions
thus 1 - SPECIAL_ACTION_DUCK * - Detect if the player is crouching.
I don't know a proper way of detecting if a player is frozen, i would say put a IsFrozen[playerid] variable at every TogglePlayerControllable line in ur script.
now to detect whether a different animation is active
Код:
if(GetPlayerAnimationIndex(playerid) != 0)
Anything left?
Reply
#3

Thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)