if(strcmp(cmdtext,"/status",true) == 0)
{
tmp = strtok(cmdtext, idx);
new giveplayerid = ReturnUser(tmp);
//if(!strlen(tmp))
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,0xFFCC2299,"~ [ERRO] Use > /status [id]");
return 1;
}
// else
// if(giveplayerid != INVALID_PLAYER_ID)
// {
new tempstringss[250];
GetPlayerName(giveplayerid,tempstringss,sizeof tempstringss);
new Float:grana = GetPlayerMoney(giveplayerid);
new Float:hvida = GetPlayerHealth(giveplayerid,hvida);
new Float:hcolete = GetPlayerArmour(giveplayerid,hcolete);
format(tempstringss,sizeof(tempstringss),"Assassinatos: %d\nMortes: %d\n Grana: %d\n Health: %d\nColete: %d",Kill,Death,grana,hvida,hcolete);
ShowPlayerDialog(giveplayerid,1,DIALOG_STYLE_MSGBOX,"Status de:%s\n",tempstringss,"OK","FECHAR");
// }
// else //if(giveplayerid == INVALID_PLAYER_ID)
// {
// format(string, sizeof(string), "~ [ERRO] '%d' nгo й um player ativo!", giveplayerid);
// SendClientMessage(playerid, 0xFFCC2299, string);
// }
return 1;
}
if(!strcmp(cmd, "/stats", true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COR_CINZA, "USE: /stats [id]");
new plid = strval(tmp);
if(IsPlayerConnected(plid))
{
new string[256], pName[MAX_PLAYER_NAME], Float:health, Float:armour;
GetPlayerName(plid, pName, sizeof pName);
format(string, sizeof string, "Stats de %s:", pName);
SendClientMessage(playerid, COR_AMARELO, string);
format(string, sizeof string, "Matou/Kill: [%d] Morreu/Died: [%d] Suicidou/Suicide: [%d] Dinheiro/Money: [%d] Score: [%d]",
pstats[plid][pkills], pstats[plid][pmortes], pstats[plid][pkillhim], GetPlayerMoney(plid), GetPlayerScore(plid));
SendClientMessage(playerid, COR_BRANCO, string);
GetPlayerHealth(plid, health);
GetPlayerArmour(plid, armour);
format(string, sizeof string, "Vida/Life: [%.1f] Colete/Armour: [%.1f]", health, armour);
SendClientMessage(playerid, COR_BRANCO, string);
} else {
SendClientMessage(playerid, 0xFF0000AA, "Jogador nгo conectado!");
}
return 1;
}
Originally Posted by Braulio_BcO
esta certim execeto a parte do health e da armour, jб tentei todas formas posiveis de mostrar o health e o armour:
%f %.3f %.2f %.1f %.0f e nгo mostra o mбximo que consegui mostrar foi 1 | 1.00 e msm assim se eu perder health nгo atualiza, esse comando funfa certim com sendclientmessage mais no ShowPlayerDialog estou tento problemas, seria necessбrio um timer para atualizar? |