Need help with animation freezing
#1

Okay, so I've copied Function from SAMP scripting site, and added my animation to it, this is how it looks like
pawn Код:
forward woodagain(playerid);
public woodagain(playerid)
{
    ApplyAnimation(playerid,"ped","BIKE_pickupL",4.1,0,0,0,1,1,1);
    SetPlayerCheckpoint(playerid, 2629.5989, -433.7548, 65.3618, 3.0);
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
    }
}
Now, after the anim ends it freezes me in place, I know it's "freeze Will freeze the player in position after the animation finishes."

But! If I set it to 0, the animation won't start up.
I had an idea of setting player position z+0.01 but, it looked abut odd.
Reply
#2

Try this:

pawn Код:
forward woodagain(playerid);
public woodagain(playerid)
{
    ApplyAnimation(playerid,"ped","BIKE_pickupL",4.1,0,0,0,1,1,1);
    SetPlayerCheckpoint(playerid, 2629.5989, -433.7548, 65.3618, 3.0);
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
    }
    TogglePlayerControllable(playerid, 1);
}
Reply
#3

Nope didn't fix it sadly :/
Reply
#4

This may help you i dont know, Havent tested it. PM me if you get anymore issues
Код:
forward woodagain(playerid);
public woodagain(playerid)
{
	TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid,"ped","BIKE_pickupL",4.1,0,0,0,1,1,1);
    SetPlayerCheckpoint(playerid, 2629.5989, -433.7548, 65.3618, 3.0);
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
    }
    TogglePlayerControllable(playerid, 1);
	SetCameraBehindPlayer(playerid);
}
Reply
#5

I suppose you could use "ClearAnimations" here, not sure though

pawn Код:
forward StopAnimation();
forward woodagain(playerid);
public woodagain(playerid)
{
    ApplyAnimation(playerid,"ped","BIKE_pickupL",4.1,0,0,0,1,1,1);
    SetTimer("StopAnimation",8000,0); // change this to whatever the anim time is
    SetPlayerCheckpoint(playerid, 2629.5989, -433.7548, 65.3618, 3.0);
    for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
    }
    TogglePlayerControllable(playerid, 1);
}
public StopAnimation(playerid) //somewhere outside all functions preferably at the end
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            TogglePlayerControllable(i,1);
            ClearAnimation(i);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)