[Ajuda] Animaзгo focada sem fim..
#1

Olб pessoas! boa noite! estou aqui tentando arrumar esse bug e desisti, e vou deitar, alguem por favor atй amanha a tarde pode me ajudar? й tipo assim, a pessoa morre, e ela vai para o hospital, lб ela toca uma animaзгo, e essa anim funfa muito bem atй na hora de o paciente ganhar alta, quando ele ou ela ganha alta, o cara fica travado em uma animaзгo por um tempo indeterminado, deitado no chгo, como as imagens abaixo mostra, acho que й algo no Timer, nгo sei, tentei e tentei de tudo e nada funfou, vou mostrar algumas informaзхes..

Pessoa em coma no HP(atй agora beleza..):


Pessoa bugada lб fora do HP com o anim(ae tб o "bug"!!!):


Cуdigo:
PHP Code:
forward AnimacaoEmComa(playerid);
new 
animacao_forcada3[MAX_PLAYERS];
animacao_forcada3[playerid] = SetTimerEx("AnimacaoEmComa"4000true"i"playerid); //Quanto tudo inicia, a anim й chamada.. e congela o jogador a cada 4 segundos;
public AnimacaoEmComa(playerid)
{
    
TogglePlayerControllable(playerid0); //congela o paciente
    
ApplyAnimation(playerid"CRACK""crckdeth2"4.1 011040000) ; //anim que cansei de mexer ae..afs meses e meses
}
public 
FuncaoHospital(id//funзгo chama para quando o paciente receber alta, ae tem mais cуdigo, coloque apenas o que precisa no momento
{
  
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id); //Essa funзгo(linha) й onde era para desligar o Timer e animaзхes, e nada, continua do mesmo modo;

Reply
#2

Adicione um SpawnPlayer para que ele dк o respawn corretamente, nгo se esqueзa de descongelar o jogador jб que vocк o congela na hora que ele fica "internado".

Edit:

E antes que eu me esqueзa, antes de adicionar o SpawnPlayer, nгo se esqueзa de setar o SetSpawnInfo para onde ele vai ser redirecionado quando a funзгo SpawnPlayer for chamada.
Reply
#3

Onde posso colocar o SpawnPlayer?

@Edit
Nгo deu certo aqui..

PHP Code:
    KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
    
SpawnPlayer(id); 
Reply
#4

Up! Alguйm?
Reply
#5

Tenta isso:
pawn Code:
forward AnimacaoEmComa(playerid);
new animacao_forcada3[MAX_PLAYERS];

animacao_forcada3[playerid] = SetTimerEx("AnimacaoEmComa", 4000, true, "i", playerid); //Quanto tudo inicia, a anim й chamada.. e congela o jogador a cada 4 segundos;

public AnimacaoEmComa(playerid)
{
    TogglePlayerControllable(playerid, 0); //congela o paciente
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1 , 0, 1, 1, 0, 4000, 0) ; //anim que cansei de mexer ae..afs meses e meses
    SetTimerEx("FuncaoHospital", 4001, false, "i", playerid); // Chamar a Funзгo
}

public FuncaoHospital(id) //funзгo chama para quando o paciente receber alta, ae tem mais cуdigo, coloque apenas o que precisa no momento
{
  KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id, 0); ClearAnimations(id); //Essa funзгo(linha) й onde era para desligar o Timer e animaзхes, e nada, continua do mesmo modo;
}
Reply
#6

Quote:
Originally Posted by SukMathcuck
View Post
Onde posso colocar o SpawnPlayer?

@Edit
Nгo deu certo aqui..

PHP Code:
    KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
    
SpawnPlayer(id); 
Й aн mesmo cara, sу que vocк tem que por onde ele vai dar o spawn agora, tipo:



Altera o X,Y,Z,Angle para a posiзгo de onde ele vai dar o spawn e troque esse pInfo pelo nome da variбvel correta que й a do salvamento da skin.

Code:
SetSpawnInfo(id, 1, pInfo[playerid][Skin], X, Y, Z, Angle, 0, 0, 0, 0, 0, 0);
    KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id, 0); ClearAnimations(id);
    SpawnPlayer(id);
Reply
#7

Quote:
Originally Posted by SalvatoreBR
View Post
Й aн mesmo cara, sу que vocк tem que por onde ele vai dar o spawn agora, tipo:



Altera o X,Y,Z,Angle para a posiзгo de onde ele vai dar o spawn e troque esse pInfo pelo nome da variбvel correta que й a do salvamento da skin.

Code:
SetSpawnInfo(id, 1, pInfo[playerid][Skin], X, Y, Z, Angle, 0, 0, 0, 0, 0, 0);
    KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id, 0); ClearAnimations(id);
    SpawnPlayer(id);
Nгo deu certo nгo, o spawn atй ficou mais rapido e taus, mais o bug da animaзгo no chгo persiste..

PHP Code:
public FuncaoHospital(id)
{
    new 
string[256], ContaBancaria PlayerInfo[id][pAccount];
    new 
Quantia PlayerInfo[id][pWantedLevel];
    
Hospital[id] = 0MedicTime[id] = 0NeedMedicTime[id] = 0;
    
PlayerInfo[id][pMuted] = 0TextDrawHideForPlayer(idAlta[id]);
    
SetPlayerVirtualWorld(id0); SetCameraBehindPlayer(id);
    if (
PlayerInfo[id][pJailed] == || PlayerInfo[id][pWantedLevel] != 0)
    {
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
SetPlayerInterior(id6);
        
PlayerInfo[id][pJailed] = 1;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], 264.628877.57421001.0391267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
format(stringsizeof(string), "<!> Vocк estб preso por %d segundos."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_LIGHTBLUEstring);
        
SendClientMessage(id0xFFFFFFFA"<!> Use /serviзo advogado para chamar um advogado.");
        
SendClientMessage(id0xFFFFFFFA"<!> Para pagar sua fianзa (digite: /pagarfianзa).");
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == || PlayerInfo[id][pWantedLevel] != 0)
    {
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
SetPlayerInterior(id3);
        
PlayerInfo[id][pJailed] = 2;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], 197.2555174.88811003.0234267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
format(stringsizeof(string), "Vocк estб preso por %d segundos."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_LIGHTBLUEstring);
        
SendClientMessage(id0xFFFFFFFA"<!> Use /serviзo advogado para chamar um advogado.");
        
SendClientMessage(id0xFFFFFFFA"<!> Para pagar sua fianзa (digite: /pagarfianзa).");
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == 3000)
    {
        
LoadInterior(id);
        
SetPlayerInterior(id0);
        
SetSpawnInfo(id142, -1974.5168323.38341556.1825267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == 4)
    {
        
format(stringsizeof(string), "* Ainda faltam %d segundos no cativeiro."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_WHITEstring);
        
PlayerInfo[id][pPnumber] = 0;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], -1104.1200, -1664.013376.4672267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
Telefoneoff[id] = 1;
    }
    else
    {
        new 
bill,tax,hour,minuite,second,year,month,day,sendername[MAX_PLAYER_NAME];
        
gettime(hour,minuite,second), getdate(yearmonthday), FixHour(hour), hour shifthour;
        
format(sendernamesizeof(sendername), "%s"PlayerName(id)), GiveNameSpace(sendername);
        
bill 120tax 17;
        
SendClientMessage(id,COLOR_SAMU,"==============================");
        
SendClientMessage(id,COLOR_WHITE,"            Recibo Hospitalar:");
        
format(stringsizeof(string),"Nome: %s Data: %d/%d/%d"sendernamedaymonthyear);
        
SendClientMessage(id,COLOR_WHITE,string);
        
format(stringsizeof(string),"Conta Hospitalar: $%d Taxa: $%d"billtax);
        
SendClientMessage(id,COLOR_WHITE,string);
        
bill+=tax;
        
format(stringsizeof(string),"Valor Total: $%d"bill);
        
SendClientMessage(id,COLOR_WHITE,string);
        if (
ContaBancaria >= bill)
        {
            
PlayerInfo[id][pAccount] = ContaBancaria bill;
            
DepositarGranaOrg(7bill);
        }
        if(
GetPlayerOrg(id) == || GetPlayerOrg(id) == 6)
        {
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1580.5143,1769.1255,10.820387.6485000000);
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
            
SpawnPlayer(id);
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Las Venturas");
        }
        else
        {
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1183.3290,-1325.6658,13.5777267.7704000000);
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
            
SpawnPlayer(id);
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Los Santos");
        }
        
SendClientMessage(id,COLOR_SAMU,"==============================");
        
SetPlayerInterior(id0);
        
SetPlayerVirtualWorld(id0);
        
PlayerPlaySound(id11500.00.00.0);
    }
    return 
true;

@edit
pensei que ia funfa

Up...
Reply
#8

Quote:
Originally Posted by alexandrealx
View Post
Tenta isso:
pawn Code:
forward AnimacaoEmComa(playerid);
new animacao_forcada3[MAX_PLAYERS];

animacao_forcada3[playerid] = SetTimerEx("AnimacaoEmComa", 4000, true, "i", playerid); //Quanto tudo inicia, a anim й chamada.. e congela o jogador a cada 4 segundos;

public AnimacaoEmComa(playerid)
{
    TogglePlayerControllable(playerid, 0); //congela o paciente
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1 , 0, 1, 1, 0, 4000, 0) ; //anim que cansei de mexer ae..afs meses e meses
    SetTimerEx("FuncaoHospital", 4001, false, "i", playerid); // Chamar a Funзгo
}

public FuncaoHospital(id) //funзгo chama para quando o paciente receber alta, ae tem mais cуdigo, coloque apenas o que precisa no momento
{
  KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id, 0); ClearAnimations(id); //Essa funзгo(linha) й onde era para desligar o Timer e animaзхes, e nada, continua do mesmo modo;
}
Tambйm nгo funcionou amigo.
Reply
#9

Quote:
Originally Posted by SukMathcuck
View Post
Nгo deu certo nгo, o spawn atй ficou mais rapido e taus, mais o bug da animaзгo no chгo persiste..

PHP Code:
public FuncaoHospital(id)
{
    new 
string[256], ContaBancaria PlayerInfo[id][pAccount];
    new 
Quantia PlayerInfo[id][pWantedLevel];
    
Hospital[id] = 0MedicTime[id] = 0NeedMedicTime[id] = 0;
    
PlayerInfo[id][pMuted] = 0TextDrawHideForPlayer(idAlta[id]);
    
SetPlayerVirtualWorld(id0); SetCameraBehindPlayer(id);
    if (
PlayerInfo[id][pJailed] == || PlayerInfo[id][pWantedLevel] != 0)
    {
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
SetPlayerInterior(id6);
        
PlayerInfo[id][pJailed] = 1;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], 264.628877.57421001.0391267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
format(stringsizeof(string), "<!> Vocк estб preso por %d segundos."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_LIGHTBLUEstring);
        
SendClientMessage(id0xFFFFFFFA"<!> Use /serviзo advogado para chamar um advogado.");
        
SendClientMessage(id0xFFFFFFFA"<!> Para pagar sua fianзa (digite: /pagarfianзa).");
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == || PlayerInfo[id][pWantedLevel] != 0)
    {
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
SetPlayerInterior(id3);
        
PlayerInfo[id][pJailed] = 2;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], 197.2555174.88811003.0234267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
format(stringsizeof(string), "Vocк estб preso por %d segundos."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_LIGHTBLUEstring);
        
SendClientMessage(id0xFFFFFFFA"<!> Use /serviзo advogado para chamar um advogado.");
        
SendClientMessage(id0xFFFFFFFA"<!> Para pagar sua fianзa (digite: /pagarfianзa).");
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == 3000)
    {
        
LoadInterior(id);
        
SetPlayerInterior(id0);
        
SetSpawnInfo(id142, -1974.5168323.38341556.1825267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
PlayerInfo[id][pJailTime] = Quantia 300;
        
PlayerInfo[id][pWantedLevel] = 0;
        
Telefoneoff[id] = 1;
    }
    else if (
PlayerInfo[id][pJailed] == 4)
    {
        
format(stringsizeof(string), "* Ainda faltam %d segundos no cativeiro."PlayerInfo[id][pJailTime]);
        
SendClientMessage(idCOLOR_WHITEstring);
        
PlayerInfo[id][pPnumber] = 0;
        
SetSpawnInfo(id1PlayerInfo[id][pChar], -1104.1200, -1664.013376.4672267.7704000000);
        
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
        
SpawnPlayer(id);
        
Telefoneoff[id] = 1;
    }
    else
    {
        new 
bill,tax,hour,minuite,second,year,month,day,sendername[MAX_PLAYER_NAME];
        
gettime(hour,minuite,second), getdate(yearmonthday), FixHour(hour), hour shifthour;
        
format(sendernamesizeof(sendername), "%s"PlayerName(id)), GiveNameSpace(sendername);
        
bill 120tax 17;
        
SendClientMessage(id,COLOR_SAMU,"==============================");
        
SendClientMessage(id,COLOR_WHITE,"            Recibo Hospitalar:");
        
format(stringsizeof(string),"Nome: %s Data: %d/%d/%d"sendernamedaymonthyear);
        
SendClientMessage(id,COLOR_WHITE,string);
        
format(stringsizeof(string),"Conta Hospitalar: $%d Taxa: $%d"billtax);
        
SendClientMessage(id,COLOR_WHITE,string);
        
bill+=tax;
        
format(stringsizeof(string),"Valor Total: $%d"bill);
        
SendClientMessage(id,COLOR_WHITE,string);
        if (
ContaBancaria >= bill)
        {
            
PlayerInfo[id][pAccount] = ContaBancaria bill;
            
DepositarGranaOrg(7bill);
        }
        if(
GetPlayerOrg(id) == || GetPlayerOrg(id) == 6)
        {
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1580.5143,1769.1255,10.820387.6485000000);
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
            
SpawnPlayer(id);
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Las Venturas");
        }
        else
        {
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1183.3290,-1325.6658,13.5777267.7704000000);
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id);
            
SpawnPlayer(id);
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Los Santos");
        }
        
SendClientMessage(id,COLOR_SAMU,"==============================");
        
SetPlayerInterior(id0);
        
SetPlayerVirtualWorld(id0);
        
PlayerPlaySound(id11500.00.00.0);
    }
    return 
true;

@edit
pensei que ia funfa

Up...
Mas como vocк estб testando aн cara? Essa parte do cуdigo que vocк alterou й para quando o jogador for preso. Vocк tem que por isso na que ele nгo vai preso.

Edit: Nгo tinha prestado atenзгo no cуdigo atй o fim, acabei de ver o final dele, foi mal.
Reply
#10

'.'

Ele sai do hospital e se caso estiver com SU, vai preso, caso contrario ele vai para fora do HP... .'

й nessa parte!:
PHP Code:
        new bill,tax,hour,minuite,second,year,month,day,sendername[MAX_PLAYER_NAME]; 
        
gettime(hour,minuite,second), getdate(yearmonthday), FixHour(hour), hour shifthour
        
format(sendernamesizeof(sendername), "%s"PlayerName(id)), GiveNameSpace(sendername); 
        
bill 120tax 17
        
SendClientMessage(id,COLOR_SAMU,"=============================="); 
        
SendClientMessage(id,COLOR_WHITE,"            Recibo Hospitalar:"); 
        
format(stringsizeof(string),"Nome: %s Data: %d/%d/%d"sendernamedaymonthyear); 
        
SendClientMessage(id,COLOR_WHITE,string); 
        
format(stringsizeof(string),"Conta Hospitalar: $%d Taxa: $%d"billtax); 
        
SendClientMessage(id,COLOR_WHITE,string); 
        
bill+=tax
        
format(stringsizeof(string),"Valor Total: $%d"bill); 
        
SendClientMessage(id,COLOR_WHITE,string); 
        if (
ContaBancaria >= bill
        { 
            
PlayerInfo[id][pAccount] = ContaBancaria bill
            
DepositarGranaOrg(7bill); 
        } 
        if(
GetPlayerOrg(id) == || GetPlayerOrg(id) == 6
        { 
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1580.5143,1769.1255,10.820387.6485000000); 
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id); 
            
SpawnPlayer(id); 
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Las Venturas"); 
        } 
        else 
        { 
            
SetSpawnInfo(id1PlayerInfo[id][pChar], 1183.3290,-1325.6658,13.5777267.7704000000); 
            
KillTimer(animacao_forcada3[id]); SetPlayerSpecialAction(id0); ClearAnimations(id); 
            
SpawnPlayer(id); 
            
SendClientMessage(idCOLOR_WHITE,"Localidade: Los Santos"); 
        } 
        
SendClientMessage(id,COLOR_SAMU,"=============================="); 
        
SetPlayerInterior(id0); 
        
SetPlayerVirtualWorld(id0); 
        
PlayerPlaySound(id11500.00.00.0); 
@edit

Blz, qual a soluзгo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)