Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetPlayerSkin after some animation/special action freezes character #87

Open
IstuntmanI opened this issue Feb 24, 2018 · 0 comments
Open

Comments

@IstuntmanI
Copy link
Contributor

IstuntmanI commented Feb 24, 2018

Just like on the wiki:
image
(not sure if there are regular animations [not special actions] that may freeze the character)

Video with the SPECIAL_ACTION_SMOKING (notice that the player changed his skin only after he started smoking, if he isn't starting that part of the special action and he changes his skin he won't get freezed):
https://www.youtube.com/watch?v=o5g-AaVYPeM
I tested it and it does the same for peeing (all time when the animation is applied). Exactly the same for drinking actions. Looks like the character can get controllable again if I simply stop the special action by pressing the cancelling button.

Possible solution:

hook SetPlayerSkin( playerid, skinid )
{
    if( !IsPlayerInAnyVehicle( playerid ) )
    {
        if( GetPlayerSpecialAction( playerid ) != SPECIAL_ACTION_NONE )
            SetPlayerSpecialAction( playerid, SPECIAL_ACTION_NONE );

        else
            ClearAnimations( playerid );
    }

    return DEFAULT_SetPlayerSkin( playerid, skinid );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant