[Ajuda] Variavel - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Variavel (
/showthread.php?tid=662920)
Variavel -
Geremias1533 - 15.01.2019
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(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;
}
Ele ja pega a Grana do jogador que esta com ele GetPlayerGrana(i);, falta a do banco.
Re: Variavel -
InsaneBR - 15.01.2019
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;
}
Re: Variavel -
Geremias1533 - 15.01.2019
Deu certo, obrigado. (Y)
LIKE