01.07.2014, 15:10
PHP код:
public Refilling(playerid, vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
{
if(!IsPlayerInAnyVehicle(playerid))
{
IsRefilling[playerid] = false;
KillTimer(RefillingTimer[playerid]);
}
if(VehicleFuel[vehicleid] == 1000)
{
SendClientMessage(playerid,COLOR_RED,"Ai facut plinul de 150Lei, Poti pleca!");
IsRefilling[playerid] = false;
IsRanOutOfFuel[vehicleid] = false;
printf("vehREFILL");
KillTimer(RefillingTimer[playerid]);
return 1;
}
IsRefilling[playerid] = true;
new TD_String[25];
VehicleFuel[vehicleid]+=1;//cause i multiple 100 to 1000 there is comming a 0 extra
new SecondFuel = VehicleFuel[vehicleid] % 10,
FirstFuel = (VehicleFuel[vehicleid] - SecondFuel) / 10;
format(TD_String, 25, "%i.%i", FirstFuel,SecondFuel);//i have 99.8 i go
TextDrawSetString(Text:Values[playerid][2], TD_String);//playerid?yea
return 1;
}