[Ajuda] Nгo tб setando...
#1

Seguinte pessoal, meu FS de experiкncia nгo tб setando o level do player em jogo, somente quando ele reloga mostra o level que deveria mostrar quando ele avanзa de nнvel .

Tб assim em OnPlayerConnect:

pawn Код:
new file2[128];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(file2,sizeof(file2),savefile,name);
        if(!fexist(file2))
            {
                DOF2_CreateFile(file2);
                DOF2_SetInt(file2,"pExp", 0);
                DOF2_SetInt(file2,"pNivel", 0);
                DOF2_SaveFile();
                DOF2_Exit();
            }
        if(fexist(file2))
        {
                Exp[playerid] = DOF2_GetInt(file2,"pExp");
                Nivel[playerid] = DOF2_GetInt(file2,"pNivel");
        }
Creio que o erro esteja aki:

pawn Код:
TimerUpdate(); public TimerUpdate()
    {
            new string[128],name[MAX_PLAYER_NAME];
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                    if (IsPlayerConnected(i))
                {
                        if(Exp[i] >= 10)
                            {
                                Exp[i] = Exp[i]-10;
                                    Nivel[i]++;
                                    GetPlayerName(i,name,sizeof(name));
                                    format(string,sizeof(string),"~b~~h~~h~~h~%s Subiu de Nivel!!!",name);
                                    GameTextForAll(string,2000,3);
                            }
                            else
                            {
                                    TextDrawHideForPlayer(i,Textdrawz1[i]);
                                    format(string, sizeof(string), "%s" ,GetExpTol(i));
                            TextDrawSetString(Textdrawz1[i],string);
                            TextDrawShowForPlayer(i,Textdrawz1[i]);
                    }
            }
            }
            return 1;
    }
...
Reply
#2

tenta subs td Timer por isto
Код:
public OnPlayerUpdate(playerid)
{
                            if(Exp[playerid] == 10)
                            {
                                    Exp[playerid] = 0;
                                    Nivel[playerid]++;
                                    GetPlayerName(playerid,name,sizeof(name));
                                    format(string,sizeof(string),"~b~~h~~h~~h~%s Subiu de Nivel!!!",name);
                                    GameTextForAll(string,2000,3);
                            }
                            else
                            {
                                    TextDrawHideForPlayer(i,Textdrawz1[playerid]);
                                    format(string, sizeof(string), "%s" ,GetExpTol(playerid));
                                    TextDrawSetString(Textdrawz1[playerid],string);
                                    TextDrawShowForPlayer(i,Textdrawz1[playerid]);
                    }
return 1;
}
e da um Debug tambйm, p ver se ta setand diretamente no DOF o seu level, na hora q vc ganha.

se n estiver coloka p setar junto quand ganha o Level.
Reply
#3

Desse jeito ai nгo vai dar certo.

Mas valeu por tentar ajudar .
Reply
#4

Serб que alguйm pode me ajudar nisso aqui ?
Reply
#5

Fбcil:
pawn Код:
TimerUpdate(); public TimerUpdate()
    {
            new string[128],name[MAX_PLAYER_NAME];
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                    if (IsPlayerConnected(i))
                {
                        if(Exp[i] >= 10)
                            {
                                Exp[i] = Exp[i]-10;
                                    Nivel[i]++;
                                    GetPlayerName(i,name,sizeof(name));
                                    format(string,sizeof(string),"~b~~h~~h~~h~%s Subiu de Nivel!!!",name);
                                    GameTextForAll(string,2000,3);
                            TextDrawHideForPlayer(i,Textdrawz1[i]);
                                    format(string, sizeof(string), "%s" ,GetExpTol(i));
                            TextDrawSetString(Textdrawz1[i],string);
                            TextDrawShowForPlayer(i,Textdrawz1[i]);
                            }
                            else
                            {
                                    TextDrawHideForPlayer(i,Textdrawz1[i]);
                                    format(string, sizeof(string), "%s" ,GetExpTol(i));
                            TextDrawSetString(Textdrawz1[i],string);
                            TextDrawShowForPlayer(i,Textdrawz1[i]);
                    }
            }
            }
            return 1;
    }
#EDITADO
Reply
#6

Ainda nгo funcionou ...

Somente relogando que ele mostra ...enquanto estб no jogo ele mostra o level que o cara se conectou.
Reply
#7

Onde vocк colocou isso:
TimerUpdate();
(Ou pode estar em Timers)
Poste onde isto estб .
Reply
#8

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
Onde vocк colocou isso:
TimerUpdate();
(Ou pode estar em Timers)
Poste onde isto estб .
Como й uma public estб junto com as outras .
Reply
#9

Mas й uma public para todos? Porque nгo atualiza para cada um? Mas nгo vem ao caso, poste:
GetExpTol
Reply
#10

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
Mas й uma public para todos? Porque nгo atualiza para cada um? Mas nгo vem ao caso, poste:
GetExpTol
GetExpTol й da experiкncia isso tб funcionando normal, cada vez que o cara mata algъem a experiencia vai subindo atй completar a barra e aumentar o nнvel...

pawn Код:
stock GetExpTol(playerid)
    {
            new Returnl[29];
            if(Exp[playerid] == 1) Returnl = " ";
            if(Exp[playerid] == 1) Returnl = "lll";
            if(Exp[playerid] == 2) Returnl = "llllll";
            if(Exp[playerid] == 3) Returnl = "lllllllll";
            if(Exp[playerid] == 4) Returnl = "llllllllllll";
            if(Exp[playerid] == 5) Returnl = "lllllllllllllll";
            if(Exp[playerid] == 6) Returnl = "llllllllllllllllll";
            if(Exp[playerid] == 7) Returnl = "lllllllllllllllllllll";
            if(Exp[playerid] == 8) Returnl = "llllllllllllllllllllllll";
            if(Exp[playerid] >= 9) Returnl = "llllllllllllllllllllllllllll";
            return Returnl;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)