SA-MP Forums Archive
Refill Bug! - 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: Refill Bug! (/showthread.php?tid=465180)



Refill Bug! - Akcent_Voltaj - 21.09.2013

i go with car till fuel is 60.0 if a mecanic refills my car to 100.0. i see 100.0 in my km then back 60.0 at fuel..please help..

PHP код:
if( listitem == 12 )
                    {
                    if(
RefillOffer[playerid] < 999)
                    {
                    if(
IsPlayerConnected(RefillOffer[playerid]))
                    {
                    if(
GetPlayerCash(playerid) > RefillPrice[playerid])
                    {
                    new 
TD_String[25];
                    
GetPlayerName(RefillOffer[playerid], giveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "* %s ti-a facut plinul acesta te-a costat %dLei.",giveplayer,RefillPrice[playerid]);
                    
SendClientMessage(playeridCOLOR_ORANGEstring);
                    
format(stringsizeof(string), "* Ai facut plinul lui %s cu %dLei",sendername,RefillPrice[playerid]);
                    
SendClientMessage(RefillOffer[playerid], COLOR_YELLOWstring);
                    
GivePlayerCash(playerid, -RefillPrice[playerid]);
                    
GivePlayerCash(RefillOffer[playerid], RefillPrice[playerid]);
                    
VehicleFuel[RefillOffer[playerid]] = 1000;
                    new 
SecondFuel VehicleFuel[RefillOffer[playerid]] % 10,//here* so i go with vehicle till fuel is 50.0 i get refill from mecaanic its 99.9 fast then 50.0 :|
                    
FirstFuel = (VehicleFuel[RefillOffer[playerid]] - SecondFuel) / 10;
                    
format(TD_String25"%i.%i"FirstFuel,SecondFuel);
                    
TextDrawSetString(Text:Values[playerid][2], TD_String);
                    
RefillOffer[playerid] = 999;
                    
RefillPrice[playerid] = 0;
                    return 
1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY"   You cant afford the Refill !");
                    return 
1;
                    }
                    }
                    return 
1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY"   No-one offered to Refill your Car !");
                    return 
1;
                    }
                    }