15.01.2019, 20:45
Alguem pode me explicar como adicionar minha variavel para pegar a Grana do Banco e mostrar no meu /RankGrana ?
Código:
Ele ja pega a Grana do jogador que esta com ele GetPlayerGrana(i);, falta a do banco.
PHP Code:
dini_Int(file2, "SaldoBancario")
PHP Code:
public MostrarRankGRANA(playerid)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(file2, sizeof(file2), PASTA_CONTAS, aname);
new
playerScores[MAX_PLAYERS][rankingEnum],
index
;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i) && pAdmin[i] == 0)
{
playerScores[index][player_Score] = GetPlayerGrana(i);
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;
}