[Ajuda] Variavel
#1

Alguem pode me explicar como adicionar minha variavel para pegar a Grana do Banco e mostrar no meu /RankGrana ?

PHP Code:
dini_Int(file2"SaldoBancario"
Código:
PHP Code:
public MostrarRankGRANA(playerid)
{
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridanamesizeof(aname));
    
format(file2sizeof(file2), PASTA_CONTASaname);
    new
           
playerScores[MAX_PLAYERS][rankingEnum],
        
index
    
;
    for(new 
i!= MAX_PLAYERS; ++i)
    {
          if(
IsPlayerConnected(i) && !IsPlayerNPC(i) && pAdmin[i] == 0)
          {
            
playerScores[index][player_Score] = GetPlayerGrana(i);
            
playerScores[index++][player_ID] = i;
        }
    }
    
GetPlayerHighestGrana(playerScores0index);
    new
          
score_Text[1000] = "",
        
player_Name[MAX_PLAYER_NAME]
    ;
    for(new 
i5; ++i)
    {
           if(
index)
          {
                
GetPlayerName(playerScores[i][player_ID], player_Namesizeof(player_Name));
                 
format(score_Textsizeof(score_Text), "%s\n{FFFFFF}» {00A600}%dº{FFFFFF} Lugar -> {0CC6F5}%s {FFFFFF}- Grana {00A600}$%d"score_Text1player_NameplayerScores[i][player_Score]);
          }
          else
          {
                
format(score_Textsizeof(score_Text), "%s\n{FFFFFF}» {FF0000}%dº{FFFFFF} Lugar ->  {FFB85C}Ninguem"score_Text1);
          }
       }
       
ShowPlayerDialog(playerid2742DIALOG_STYLE_MSGBOX"{FFFFFF}Top 5{00A600} Grana"score_Text"Fechar""");
     return 
true;

Ele ja pega a Grana do jogador que esta com ele GetPlayerGrana(i);, falta a do banco.
Reply
#2

pawn Code:
public MostrarRankGRANA(playerid)
{
    new
        aname[MAX_PLAYER_NAME],
        playerScores[MAX_PLAYERS][rankingEnum],
        index
    ;
    for(new i; i != MAX_PLAYERS; ++i)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i) && pAdmin[i] == 0)
        {
            GetPlayerName(i, aname, sizeof(aname));
            format(file2, sizeof(file2), PASTA_CONTAS, aname);
            playerScores[index][player_Score] = (GetPlayerGrana(i)+dini_Int(file2, "SaldoBancario"));
            playerScores[index++][player_ID] = i;
        }
    }  
    GetPlayerHighestGrana(playerScores, 0, index);  
    new
        score_Text[1000] = "",
        player_Name[MAX_PLAYER_NAME]
    ;
    for(new i; i < 5; ++i)
    {
        if(i < index)
        {
            GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
            format(score_Text, sizeof(score_Text), "%s\n{FFFFFF}» {00A600}%dє{FFFFFF} Lugar -> {0CC6F5}%s {FFFFFF}- Grana {00A600}$%d", score_Text, i + 1, player_Name, playerScores[i][player_Score]);
        }
        else
        {
            format(score_Text, sizeof(score_Text), "%s\n{FFFFFF}» {FF0000}%dє{FFFFFF} Lugar ->  {FFB85C}Ninguem", score_Text, i + 1);
        }
     }
     ShowPlayerDialog(playerid, 2742, DIALOG_STYLE_MSGBOX, "{FFFFFF}Top 5{00A600} Grana", score_Text, "Fechar", "");
     return true;
}
Reply
#3

Deu certo, obrigado. (Y)
LIKE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)