Dealership help,
#7

So I have the LoadCar() function that loads and gets linked with CarInfo, Which is this:
pawn Код:
enum vInfo
{
    vModel,
    Float:vLocationx,
    Float:vLocationy,
    Float:vLocationz,
    Float:vAngle,
    vColorOne,
    vColorTwo,
    vOwner[MAX_PLAYER_NAME],
    vDescription[MAX_PLAYER_NAME],
    vValue,
    vLicense,
    vRegistration,
    vOwned,
    vLock,
    ownedvehicle,
};
new CarInfo[456][vInfo];
So looking at the LoadCar() function, I need to practically make a buycar command, I have a SaveCars() function also, which uses the vInfo enums', which get set when you buy a car...

SaveCars:
pawn Код:
public SaveCars()
{
    new idx;
    new File: file2;
    while (idx < sizeof(CarInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d\n",
        CarInfo[idx][vModel],
        CarInfo[idx][vLocationx],
        CarInfo[idx][vLocationy],
        CarInfo[idx][vLocationz],
        CarInfo[idx][vAngle],
        CarInfo[idx][vColorOne],
        CarInfo[idx][vColorTwo],
        CarInfo[idx][vOwner],
        CarInfo[idx][vDescription],
        CarInfo[idx][vValue],
        CarInfo[idx][vLicense],
        CarInfo[idx][vOwned],
        CarInfo[idx][vLock]);
        if(idx == 0)
        {
            file2 = fopen("CarOwnership.cfg", io_write);
        }
        else
        {
            file2 = fopen("CarOwnership.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}
Reply


Messages In This Thread
Dealership help, - by Jack_Leslie - 09.08.2011, 09:44
Re: Dealership help, - by Tee - 09.08.2011, 09:51
Re: Dealership help, - by Jack_Leslie - 09.08.2011, 09:53
Re: Dealership help, - by Tee - 09.08.2011, 09:54
Re: Dealership help, - by Jack_Leslie - 09.08.2011, 09:57
Re: Dealership help, - by Tee - 09.08.2011, 10:04
Re: Dealership help, - by Jack_Leslie - 09.08.2011, 10:09
Re: Dealership help, - by Tee - 09.08.2011, 10:13
Re: Dealership help, - by Jack_Leslie - 09.08.2011, 10:15

Forum Jump:


Users browsing this thread: 1 Guest(s)