[Ajuda] Qual й a forma correta
#1

Qual й a forma correta de fazer isto?

Код:
CMD:info(playerid)
{
	new string[128];
	format(string, 128, "{FFFFFF}Matou: {FFA500}%i \n", GetPlayerScore(playerid));
	format(string, 128, "{FFFFFF}Morreu: {FFA500}%i \n", GetPlayerScore(playerid));
	format(string, 128, "(FFFFFF)Dinheiro: {FFA500}R$ %i \n", GetPlayerMoney(playerid));
	return
		ShowPlayerDialog(playerid,9494, DIALOG_STYLE_MSGBOX, "{FFA500}» {FFFFFF}SUAS INFORMAЗХES{FFA500}«",string, "Fechar", "");
}
Pois dessa forma nгo funciona.
Reply
#2

pawn Код:
CMD:info(playerid) {
     new String[200];
     format(String, sizeof(String), "{FFFFFF}Matou: {FFA500}%i\n", GetPlayerScore(playerid));
     strcat(String, "{FFFFFF}Morreu: {FFA500}%i \n", GetPlayerScore(playerid));
     strcat(String, "(FFFFFF)Dinheiro: {FFA500}R$ %i \n", GetPlayerMoney(playerid));
     ShowPlayerDialog(playerid,9494, DIALOG_STYLE_MSGBOX, "{FFA500}» {FFFFFF}SUAS INFORMAЗХES{FFA500}«",string, "Fechar", "");
     return 1;
}
Tenta aн
Reply
#3

Da seguinte forma manolo:

pawn Код:
CMD:info(playerid)
{
    new string[128];
    format(string, 128, "{FFFFFF}Matou: {FFA500}%d \n{FFFFFF}Morreu: {FFA500}%d\nFFFFFF)Dinheiro: {FFA500}R$ %d",PlayerInfo[playerid][Matou],PlayerInfo[playerid][Morreu],GetPlayerMoney(playerid));
    //Muda os PlayerInfo[playerid][Matou/Morreu] Pela variavel das mesmas!
    ShowPlayerDialog(playerid,9494, DIALOG_STYLE_MSGBOX, "{FFA500}» {FFFFFF}SUAS INFORMAЗХES{FFA500}«",string, "Fechar", "");
    return 1;
}
Estude estas modificaзхes que eu fiz! (:
Reply
#4

Use strcat ou adicione a ъltima string '%s' no format
Reply
#5

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
CMD:info(playerid) {
     new String[200];
     format(String, sizeof(String), "{FFFFFF}Matou: {FFA500}%i\n", GetPlayerScore(playerid));
     strcat(String, "{FFFFFF}Morreu: {FFA500}%i \n", GetPlayerScore(playerid));
     strcat(String, "(FFFFFF)Dinheiro: {FFA500}R$ %i \n", GetPlayerMoney(playerid));
     ShowPlayerDialog(playerid,9494, DIALOG_STYLE_MSGBOX, "{FFA500}» {FFFFFF}SUAS INFORMAЗХES{FFA500}«",string, "Fechar", "");
     return 1;
}
Tenta aн
Sу apareceu a primeiro gigante!
Da pra mostrar valores em strcat?
Reply
#6

matou = killerid

morreu = playerid

vocк tem que criar variaveis pra fazer ele funcionarem na onplayerdeath e quando forem chamadas
Reply
#7

pawn Код:
new Morreu[MAX_PLAYERS], Matou[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    Morreu[playerid]++;
    Matou[killerid]++;
    return 1;
}

CMD:info(playerid)
{
    new String[128];
    format(String, sizeof(String), "{FFFFFF}Matou: {FFA500}%i \n {FFFFFF}Morreu: {FFA500}%i \n {FFFFFF}Dinheiro: {FFA500}R$ %i", Matou[playerid], Morreu[playerid], GetPlayerMoney(playerid));
    ShowPlayerDialog(playerid, 9494, DIALOG_STYLE_MSGBOX, "{FFA500}» {FFFFFF}SUAS INFORMAЗХES{FFA500}«", String, "Fechar", "");
    return true;
}
Ainda seria necessбrio salvar os dados das variбveis Matou e Morreu no arquivo do jogador.
Reply
#8

Valeu gigante, consegui! Obrigado!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)