SA-MP Forums Archive
[AJUDA]X1 - 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]X1 (/showthread.php?tid=298921)



[AJUDA]X1 - Victor_Souz4 - 23.11.2011

Olб pessoal gostaria de saber como colocar Vida Restante do player dps que o x1 acaba tipo 100 do colete + 100 da vida seria 200 total de vida restante:

pawn Код:
new Float:armour = GetPlayerArmour(killerid,armour);
            new Float:health = GetPlayerHealth(killerid,health);
            new Float:Total = GetPlayerHealth(killerid,Total) + GetPlayerHealth(killerid,Total);
            if(armour>0)  {format(stringx, sizeof(stringx), "{EE6363}[DUELO]: %s Derrotou %s (Vida Restante: %1f)",kname,pname,Total);}
            if(armour==0) {format(stringx, sizeof(stringx), "{EE6363}[DUELO]: %s Derrotou %s (Vida Restante: %1f)",kname,pname,Total);}



Re: [AJUDA]X1 - rjjj - 23.11.2011

Isto deve resolver o seu problema :



Vocк deve criar as variбveis que armazenarгo a vida e o colete do jogador e somente depois usar as funзхes GetPlayerHealth e GetPlayerArmour, pois as mesmas nгo retornam o valor daqueles .


pawn Код:
new Float:armour;
new Float:health;
GetPlayerArmour(killerid,armour);
GetPlayerHealth(killerid,health);
new Float:Total = armour + health;
format(stringx, sizeof(stringx), "{EE6363}[DUELO]: %s Derrotou %s (Vida Restante: %1f)",kname,pname,Total);


Espero ter ajudado .


Re: [AJUDA]X1 - Victor_Souz4 - 23.11.2011

Olб rjj funcionou diboa mais tipo aapareceu assim "200.0" tem como tirar esse .0 ?


Re: [AJUDA]X1 - Pharrel - 23.11.2011

Ja que o rjjj esta off vou responder
pawn Код:
format(stringx, sizeof(stringx), "{EE6363}[DUELO]: %s Derrotou %s (Vida Restante: %d)",kname,pname,floatround(Total));