How to Save VahicleHealth in Dini file?
#3

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
I never used dini, but isn't there "dini_FloatSet();" for doing this?

pawn Код:
new hp; GetVehicleHealth(vehicleid, hp);
dini_FloatSet(formatLD,"Health", hp);
And btw, your code will look better this way:
pawn Код:
public SaveModsForAll(vehicleid)
{
    new formatLD[256];
    format(formatLD,sizeof(formatLD),"Sistema/Cars/%d.mods",vehicleid);
    if(!dini_Exists(formatLD)) { dini_Create(formatLD); }

    dini_IntSet(formatLD,"mod1",TuneCar[vehicleid][mod1]);
    dini_IntSet(formatLD,"mod2",TuneCar[vehicleid][mod2]);
    dini_IntSet(formatLD,"mod3",TuneCar[vehicleid][mod3]);
    dini_IntSet(formatLD,"mod4",TuneCar[vehicleid][mod4]);
    dini_IntSet(formatLD,"mod5",TuneCar[vehicleid][mod5]);
    dini_IntSet(formatLD,"mod6",TuneCar[vehicleid][mod6]);
    dini_IntSet(formatLD,"mod7",TuneCar[vehicleid][mod8]);
    dini_IntSet(formatLD,"mod9",TuneCar[vehicleid][mod9]);
    dini_IntSet(formatLD,"mod10",TuneCar[vehicleid][mod10]);
    dini_IntSet(formatLD,"mod11",TuneCar[vehicleid][mod11]);
    dini_IntSet(formatLD,"mod12",TuneCar[vehicleid][mod12]);
    dini_IntSet(formatLD,"mod13",TuneCar[vehicleid][mod13]);
    dini_IntSet(formatLD,"mod14",TuneCar[vehicleid][mod14]);
    dini_IntSet(formatLD,"mod15",TuneCar[vehicleid][mod15]);
    dini_IntSet(formatLD,"mod16",TuneCar[vehicleid][mod16]);
    dini_IntSet(formatLD,"mod17",TuneCar[vehicleid][mod17]);
    dini_IntSet(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
    dini_IntSet(formatLD,"color1",TuneCar[vehicleid][colorA]);
    dini_IntSet(formatLD,"color2",TuneCar[vehicleid][colorB]);
    new Float:health; GetVehicleHealth(vehicleid, health);
    dini_FloatSet(formatLD,"Health", health);
   
    return 1;
}
Even better if he uses TuneCar[vehicleid][mod][0] to [17] instead of all those codes .
Reply


Messages In This Thread
How to Save VahicleHealth in Dini file? - by CJoao - 02.08.2011, 10:34
Re: How to Save VahicleHealth in Dini file? - by iPLEOMAX - 02.08.2011, 10:51
Re: How to Save VahicleHealth in Dini file? - by alpha500delta - 02.08.2011, 11:04
Re: How to Save VahicleHealth in Dini file? - by CJoao - 02.08.2011, 17:21

Forum Jump:


Users browsing this thread: 1 Guest(s)