SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 15/01/2019, 08:45 PM   #1
Geremias1533
Big Clucker
 
Join Date: Dec 2017
Posts: 51
Reputation: 0
Default Variavel

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.
Geremias1533 is offline   Reply With Quote
Old 15/01/2019, 09:17 PM   #2
InsaneBR
Big Clucker
 
InsaneBR's Avatar
 
Join Date: Feb 2018
Posts: 104
Reputation: 8
Default Re: Variavel

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;
}
InsaneBR is offline   Reply With Quote
Old 15/01/2019, 11:21 PM   #3
Geremias1533
Big Clucker
 
Join Date: Dec 2017
Posts: 51
Reputation: 0
Default Re: Variavel

Deu certo, obrigado. (Y)
LIKE
Geremias1533 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Variavel Scorpion659 Português/Portuguese 5 28/04/2017 05:11 PM
[Ajuda] Variavel Standby Português/Portuguese 2 27/12/2015 01:30 AM
[Ajuda] RG/variavel AssasinoLM Português/Portuguese 8 16/02/2015 10:17 PM
[Ajuda] Variável ArthurxD Português/Portuguese 12 10/09/2014 12:24 AM
[Ajuda] Variavel WendeLKILL Português/Portuguese 5 28/05/2014 04:39 PM


All times are GMT. The time now is 07:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.