SA-MP Forums Archive
Float on Textdraws? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Float on Textdraws? (/showthread.php?tid=582706)



Float on Textdraws? - Metharon - 22.07.2015

i want to make the damage amount to be like 32.0 damage distance: 10 meters

...but i can't get it
pawn Код:
if(issuerid != INVALID_PLAYER_ID && weaponid != 0)
    {
        new Float: dauna;
        new string[456];
        if(DamageInfo[playerid] == 1)
        {
            format(string, sizeof(string), "~R~%0.3f damage primit - %0.3f", dauna, GetDistanceBetweenPlayers(playerid,issuerid));
            PlayerTextDrawSetString(playerid, DamageInfoTD[playerid], string);
            PlayerTextDrawShow(playerid, DamageInfoTD[playerid]);
            SetTimerEx("HideDamageInfo", 1500, false, "i", playerid);
        }
        if(DamageInfo[issuerid] == 1)
        {
            format(string, sizeof(string), "~G~%0.3f damage dat - %0.3f", dauna, GetDistanceBetweenPlayers(playerid,issuerid));
            PlayerTextDrawSetString(issuerid, DamageInfoTD[issuerid], string);

            PlayerTextDrawShow(issuerid, DamageInfoTD[issuerid]);

            SetTimerEx("HideDamageInfo", 1500, false, "i", issuerid);
        }
    }



Re: Float on Textdraws? - xVIP3Rx - 22.07.2015

I don't understand, but if you want only 1 decimal value after the dot(.), make "%0.1f", and if you don't want it to be a float use floatround


Re: Float on Textdraws? - Metharon - 22.07.2015

Thanks fixed.