[Ajuda] Patente
#1

Gostaria de saber por que nгo estб atualizando as patente:

Cуdigo:

pawn Код:
stock GetarRank(playerid)
{
    new NomeRank[30];
   
    if(PlayerDados[playerid][Level] == 0) { NomeRank = "Novato"; }
    if(PlayerDados[playerid][Level] == 1) { NomeRank = "Recruta"; }
    if(PlayerDados[playerid][Level] == 2) { NomeRank = "Soldado"; }
    if(PlayerDados[playerid][Level] == 3) { NomeRank = "Cabo"; }
    if(PlayerDados[playerid][Level] == 4) { NomeRank = "Sargento"; }
   
    return NomeRank;
}
Forward pбra atualizar:

pawn Код:
forward Atualizar(); public Atualizar()
{
                new PatentesDoDioner[128];
        format(PatentesDoDioner, 128, "~g~~h~     ~>~Ranking~<~~n~~h~    %s", GetarRank(x));
        TextDrawSetString(Patentes, PatentesDoDioner);
        TextDrawShowForPlayer(x, Patentes);
          return 1;
}
Reply
#2

pawn Код:
forward Atualizar(); public Atualizar()
{
    new
        PatentesDoDioner[ 128 ];

    for( new x = 0; x < MAX_PLAYERS; x++ )
    {
        format( PatentesDoDioner, 128, "~g~~h~     ~>~Ranking~<~~n~~h~    %s", GetarRank( x ));
        TextDrawSetString( Patentes, PatentesDoDioner );
        TextDrawShowForPlayer( x, Patentes );
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Rodney Francalim
Посмотреть сообщение
pawn Код:
forward Atualizar(); public Atualizar()
{
    new
        PatentesDoDioner[ 128 ];

    for( new x = 0; x < MAX_PLAYERS; x++ )
    {
        format( PatentesDoDioner, 128, "~g~~h~     ~>~Ranking~<~~n~~h~    %s", GetarRank( x ));
        TextDrawSetString( Patentes, PatentesDoDioner );
        TextDrawShowForPlayer( x, Patentes );
    }
    return 1;
}
Sim isso ja tem mais ele nгo atualiza corretamente, ele vai de novato para soldado..
Reply
#4

Quote:
Originally Posted by Gleisson_.
Посмотреть сообщение
Sim isso ja tem mais ele nгo atualiza corretamente, ele vai de novato para soldado..
O PlayerDados[playerid][Level] й igual ao GetPlayerScore ?
Reply
#5

Quote:
Originally Posted by [THs]ShadoW
Посмотреть сообщение
O PlayerDados[playerid][Level] й igual ao GetPlayerScore ?
Nгo.
Reply
#6

Vocк estб usando SetTimer ou SetTimerEx?
Reply
#7

Quote:
Originally Posted by Gustavo_Carvalho
Посмотреть сообщение
Vocк estб usando SetTimer ou SetTimerEx?
Que que tem a ver mano ¬¬
Reply
#8

Se vocк estiver usando SetTimer com playerid no lugar de SetTimerEx, vai bugar o textdraw para todos do servidor.

Simples, ignorante.
Reply
#9

Se nгo conseguir resolver agora, desiste. rs!

pawn Код:
new Text:Patentes[MAX_PLAYERS]; // Textdraw Global

public OnGameModeInit()
{
    for(new i; i<MAX_PLAYERS; i++)          
    {
        Patentes[i] = TextDrawCreate...
    }
    return true;
}

stock GetarRank(playerid)
{
    switch (PlayerDados[playerid][Level])
    {
        case 0: NomeRank = "Novato";      
        case 1: NomeRank = "Recruta";        
        case 2: NomeRank = "Soldado";        
        case 3: NomeRank = "Cabo";        
        case 4: NomeRank = "Sargento";        
    }
    return true;
}

forward Atualizar();
public Atualizar()
{
    new string[50];
    for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        format(string, 50, "~g~~h~     ~>~Ranking~<~~n~~h~    %s", GetarRank(i));
        TextDrawSetString(Patentes[i], string), TextDrawShowForPlayer(i, Patentes[i]);        
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)