[Ajuda] Executar novamente a animaзгo
#1

Olб, queria saber se por exemplo:
Quando alguem estive-se a fazer uma anim, e depois saisse do servidor. Quando volta-se a entrar voltava a fazer a anim novamente. Queria saber se isso й possivel, se for podem me ajudar?

Sem mais, dookie
Reply
#2

Sim... Nгo entendi se esse /q й durante ou depois da animaзгo...
Mas se for durante a animaзгo basta fazer um timer e uma variavel ao executar o anim.
Esse timer, deve ter tempo suficiente para parar a animзгo. Codк deve zerar a varнavel.
Entгo em OnPlayerDisconnect, salve o valor dessa variбvel...
E entгo quando logar, se essa varнavel for diferente de 0, aplica a animзгo.

Exemplo:

pawn Код:
new Variavel[5]; //  ou new Variavel[MAX_PLAYERS];
new FirtSpawn[5]; // ou new FirtSpawn[MAX_PLAYERS];

forward Animation(playerid);
public Animation(playerid)
{
    Variavel[playerid] = 0;
    return 1;
}

CMD:anim(playerid)
{
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1); // Aplica a animзгo
    Variavel[playerid] = 1; // Seta a varнavel pra um que vai representar.
    SetTimerEx("Animation",3000,false,"i",playerid); // Aplica o timer que vai zerar a variavel.
    return 1;
}

OnPlayerDisconnect(playerid,reason)
{
    // Nгo sei como vocк ta salvando dados...
    Funзгo_SalvarInteger("exemplo.txt","anim",Variavel[playerid]);
    return 1;
}

OnPlayerConnect(playerid)
{
    FirtSpawn[playerid] = 1;
    return 1;
}

OnPlayerSpawn(playerid)
{
    if(FirtSpawn == 1)
    {
        switch(Funзгo_LerInteger("exemplo.txt","anim"))
        {
            case 1: ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
            // case 2: Aplica mais animaзхes...
        }
        FirSpawn[playerid] = 0;
    }
    return 1;
}
Reply
#3

Obrigado ARAKUTA +1REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)