Animation focused endless
#1

Hello! I'm here trying to fix and give up, so, the person dies, and she goes to the hospital, in a coma, the player plays an animation, and this animation works fine until the time the patient is discharged from the hospital when the player discharged, the player is locked in an animation indefinitely, lying on the ground, as the pictures shows, I think it is something the Timer, do not know, I tried and tried everything and nothing really worked, I will show some information. .

Player comatose (so far, so good ..):


player with error with an endless animation (this is the error!):


PHP код:
forward AnimacaoEmComa(playerid);
new 
animacao_forcada3[MAX_PLAYERS];
animacao_forcada3[playerid] = SetTimerEx("AnimacaoEmComa"4000true"i"playerid); //When it starts, the animation is called .. and freezes the player every 4 seconds;
public AnimacaoEmComa(playerid)
{
    
TogglePlayerControllable(playerid0); 
    
ApplyAnimation(playerid"CRACK""crckdeth2"4.1 011040000) ; //animation tired to modify, months and months trying
}
public 
FuncaoHospital(id//function call to when the patient is discharged, have more code in this function, put only what you need
{
  
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id); //This function is to disconnect / end the Timer and animations;

Reply
#2

Can you show the code where you call FuncaoHospital ?
Reply
#3

PHP код:
forward FuncaoHospital(id);
public 
FuncaoHospital(id)
{
 
    }
    return 
true;

Reply
#4

please someone? it is urgent the code above!
Reply
#5

Where are you actually using SetTimerEx to call 'FuncaoHospital(id)'
You don't need a timer for the animation either... ApplyAnimation has a 'loop' parameter which will make the animation run continuously until stopped with ClearAnimations or another animation is played.

pawn Код:
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 0, 0, 1); // Call this when a player is meant to get the animation

forward FuncaoHospital(id);
public FuncaoHospital(id) // When the player is discharged
{
    SetPlayerSpecialAction(id, 0);
    ClearAnimations(id);
    return 1;
}
Reply
#6

PHP код:
forward AnimacaoEmComa(playerid); 
new 
animacao_forcada3[MAX_PLAYERS]; 

public 
AnimacaoEmComa(playerid
{  
    
ApplyAnimation(playerid"CRACK""crckdeth2"4.1 111040000) ; //animation set up to be in a continuos loop


public 
FuncaoHospital(id//function call to when the patient is discharged, have more code in this function, put only what you need 

  
SetPlayerSpecialAction(id0); 
  
ClearAnimations(id); //This function is to disconnect / end the Timer and animations; 

If it is still not working please reply with the code for FuncaoHospital and also where you use the FuncaoHospital function.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)