SA-MP Forums Archive
[ajuda] como pegar vida do jogador - 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] como pegar vida do jogador (/showthread.php?tid=343947)



[ajuda] como pegar vida do jogador - mengueh - 19.05.2012

pawn Код:
CMD:verificar(playerid, params[])
{
    new id, string[128], nome[24], Float:health, strcata[128];
    if(PlayerInfo[playerid][mAdmin] < 1) return SendClientMessage(playerid, VERMELHO, falha);
    if(sscanf(params, "d", id)) return SendClientMessage(playerid, BRANCO, "[INFO]: /verificar [playerid]");
    {
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[INFO]: Jogador invбlido!");
        GetPlayerName(id, nome, 24);
        format(string, sizeof(string), "Vida: %d\n", GetPlayerHealth(id, health));
        strcat(strcata, string);

        ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Verificaзгo do personagem", strcata, "Fechar", "Cancelar");
    }
    return 1;
   
   
}
Sу que tб pegando apenas o nъmero 1. LOL.
Mesmo eu tendo 100 de vida.


Re: [ajuda] como pegar vida do jogador - BreakDriFT - 19.05.2012

Bom usa %f no lugar de %d


pawn Код:
format(string, sizeof(string), "Vida: %f\n", GetPlayerHealth(id, health));

A Vida de Todos Sгo e Float's Assim como nas Cords


Flw


Re: [ajuda] como pegar vida do jogador - mengueh - 19.05.2012

Quote:
Originally Posted by BreakDriFT
Посмотреть сообщение
Bom usa %f no lugar de %d


pawn Код:
format(string, sizeof(string), "Vida: %f\n", GetPlayerHealth(id, health));

A Vida de Todos Sгo e Float's Assim como nas Cords


Flw
Beleza, sу que agora tб ficando assim : VIDA : 0.000000


Re: [ajuda] como pegar vida do jogador - BreakDriFT - 19.05.2012

pawn Код:
format(string, sizeof(string), "Vida: %.0f\n", GetPlayerHealth(id, health));

Tenta


Re: [ajuda] como pegar vida do jogador - mengueh - 19.05.2012

Cara, nгo й o problema de quantos 0 depois do . eu quero, e sim tб dizendo que meu jogador tem 0 de vida, sendo que tб cheio (100) e.e


Re: [ajuda] como pegar vida do jogador - BreakDriFT - 19.05.2012

AAA Entendi jaja dou um Edit =)

Intendi outra coisa Porque Voce Escreveu la 0.0000 ahsuahusas


Re: [ajuda] como pegar vida do jogador - Don_Speed - 19.05.2012

Cria Outro Mostrando Sua Vida
pawn Код:
format(string, sizeof(string), "Sua Vida: %d\n", GetPlayerHealth(playerid, health));
        strcat(strcata, string);



Re: [ajuda] como pegar vida do jogador - mengueh - 19.05.2012

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение
Cria Outro Mostrando Sua Vida
pawn Код:
format(string, sizeof(string), "Sua Vida: %d\n", GetPlayerHealth(playerid, health));
        strcat(strcata, string);
Tu nгo mudou nada, parabйns

@edit
Jб consegui.