SA-MP Forums Archive
ApplyAnimation & PlayerPlaySound problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ApplyAnimation & PlayerPlaySound problems (/showthread.php?tid=608480)



ApplyAnimation & PlayerPlaySound problems - Dayrion - 01.06.2016

Hello.
I'm doing a reload command but I have some troubles.
First is with Applying an animation. If the player doesn't move during the animation he will be freeze. The function is working anyway.
PHP код:
forward noAnim(playerid);
public 
noAnim(playerid)
{
    if(
crounch(playerid)) ApplyAnimation(playerid"PED""GUNCROUCHFWD"4.1000011), SCM(playerid, -1"crounch");
    else 
ApplyAnimation(playerid"PED""IDLE_STANCE"4.1000011), SCM(playerid, -1"not crounch");
    
SCM(playerid, -1"noAnim - Done");
    
    
/*
    ApplyAnimation(playerid, "PED", "IDLE_STANCE", 4.1, 0, 0, 0, 0, 1, 1) // Debout
    ApplyAnimation(playerid, "PED", "WEAPON_CROUCH", 4.1, 0, 0, 0, 0, 1, 1) // Crounch
    ApplyAnimation(playerid, "PED", "GUNCROUCHFWD", 4.1, 0, 0, 0, 0, 1, 1) // Crounch
    */
    
return 1;

The second is with PlayerPlaySound. Just, there is no sound..
PHP код:
PlayerPlaySound(playerid36401000); 
Have you other sound ID for reloading weapons?
Thanks for your help.


Re: ApplyAnimation & PlayerPlaySound problems - OmegaKiller72 - 01.06.2016

else ClearPlayerAnimation(playerid)


Re: ApplyAnimation & PlayerPlaySound problems - Dayrion - 02.06.2016

This is not what I want.


Re: ApplyAnimation & PlayerPlaySound problems - Nin9r - 02.06.2016

SetTimerEx("StopAnim", 3000, false, "i", playerid);

public StopAnim(playerid)
{
ClearAnimations(playerid);
return 1;
}


Re: ApplyAnimation & PlayerPlaySound problems - Dayrion - 02.06.2016

Like I said, I dont' want to use ClearAnimations(..).
Код:
Clears all animations for the given player (it also cancels all current tasks such as jetpacking,parachuting,entering vehicles, driving (removes player out of vehicle), swimming, etc.. ).
It's why I don't want to use it.


Re: ApplyAnimation & PlayerPlaySound problems - justjamie - 02.06.2016

i use this:
PHP код:
COMMAND:clear(playerid)
{
    
ApplyAnimation(playerid"CARRY""crry_prtial"1.000000);
    return 
1;

this animation cancels every other animations


Re: ApplyAnimation & PlayerPlaySound problems - Dayrion - 02.06.2016

Quote:
Originally Posted by justjamie
Посмотреть сообщение
i use this:
PHP код:
COMMAND:clear(playerid)
{
    
ApplyAnimation(playerid"CARRY""crry_prtial"1.000000);
    return 
1;

this animation cancels every other animations
Perfect. +repped.

Sound problem solved.
PHP код:
PlayerPlaySound(playerid36401000); 
I put this everywhere instead of
PHP код:
PlayerPlaySound(playerid364010.00.00.0);