Floatround problem
#1

Hi all.
I have a problem with floatround function.
I'm trying to script a command where when you type /fix (/ripara in the code) it fixes your vehicle substracting 1 $ per damage, but when you try to execute it the price is like -129837297$
pawn Код:
if(InRangeOfIcon(playerid, 11) == 1)
    {
        if(GetPlayerVehicleID(playerid) > 0)
        {
            new vid = GetPlayerVehicleID(playerid);
            if(meccanicionline > 0) return SendErrorMessage(playerid, "Ci sono dei meccanici online.");
            new soldi;
            new Float:danno;
            new str[128];
            GetVehicleHealth(vid, danno);
            new danno1 = floatround(danno1, floatround_tozero);
            soldi = 1000-danno1;
            if(Character[playerid][Cash] >= soldi)
            {
                GivePlayerMoneyEx(playerid, -soldi);
                RepairVehicle(vid);
                Vehicles[vid][Broken] = 0;
                if(IsPlayerVehicle(vid)) MYSQL_Update_Interger(Vehicles[vid][SQLID], "PlayerVehicles", "Broken", 0);
                format(str, sizeof(str), "Hai riparato il tuo veicolo per $%d", soldi);
                SendInfoMessage(playerid, str);
                return 1;
            }
            else
            {
                SendErrorMessage(playerid, ERROR_MONEY);
            }

        }
    }
Thank you in advance for your help
Reply


Messages In This Thread
Floatround problem - by alanhutch - 18.04.2018, 13:59
Re: Floatround problem - by jasperschellekens - 18.04.2018, 14:10
Re: Floatround problem - by alanhutch - 18.04.2018, 15:19
Re: Floatround problem - by alanhutch - 21.04.2018, 17:26
Re: Floatround problem - by JesterlJoker - 21.04.2018, 17:30
Re: Floatround problem - by alanhutch - 21.04.2018, 17:33
Re: Floatround problem - by JesterlJoker - 21.04.2018, 17:55

Forum Jump:


Users browsing this thread: 2 Guest(s)