Coches en venta.
#1

Hola, puse un sistema de vehнculos en venta de ZC, y que pasa, funciona todo correctamente, creo el vehнculo en venta me desconecto y sigue ahн bien, compro un vehнculo, me desconecto y tambiйn funciona, el problema es cuando reinicio el servidor desaparecen los vehнculos a la venta, el mio propio sigue estando, los de venta no mas, por lo que quiere decir que no lee el carsale.cfg, te dejo el loadCarsale y saveCarsale por las dudas. El carsale.cfg se crea correctamente y dentro de el figura el vehiculo en venta.
Gracias por comentar.

Код:
loadCarSale()
{
    if(!fexist("carsale.cfg")) return 1;
    new text_info[68],szFileStr[1024],File: iFileHandle = fopen("carsale.cfg", io_read),iIndex;
    while(iIndex < sizeof(varCarSale) && fread(iFileHandle, szFileStr))
    {
        sscanf(szFileStr, "p<|>ffffffffii",
            varCarSale[iIndex][CSVehSpawn][0],
            varCarSale[iIndex][CSVehSpawn][1],
            varCarSale[iIndex][CSVehSpawn][2],
            varCarSale[iIndex][CSVehSpawn][3],
            varCarSale[iIndex][VehSpawn][0],
            varCarSale[iIndex][VehSpawn][1],
            varCarSale[iIndex][VehSpawn][2],
            varCarSale[iIndex][VehSpawn][3],
            varCarSale[iIndex][CSVehCost],
            varCarSale[iIndex][CSVehModel]);
        if(varCarSale[iIndex][CSVehModel] > 410)
        {
            new carcreated = CreateVehicle(varCarSale[iIndex][CSVehModel], varCarSale[iIndex][CSVehSpawn][0], varCarSale[iIndex][CSVehSpawn][1], varCarSale[iIndex][CSVehSpawn][2], varCarSale[iIndex][CSVehSpawn][3], 0, 0, 6);
            format(text_info, sizeof(text_info), "(%d) %s en Venta | Precio: %d", iIndex,GetVehicleName(carcreated), varCarSale[iIndex][CSVehCost]);
            varCarSale[iIndex][CSVehicleLabel] = CreateDynamic3DTextLabel(text_info,COLOR_GENERAL,0.0, 0.0, 0.0,8.0,INVALID_PLAYER_ID,carcreated);
            varCarSale[iIndex][CSVehId] = carcreated;
        }
        ++iIndex;
    }
    print("[script] Sale Cars Loaded Successfully . . .");
    return fclose(iFileHandle);
}
Код:
saveCarSale()
{
    new szFileStr[512],File: fHandle = fopen("carsale.cfg", io_write);

    for(new iIndex; iIndex < MAX_CARSALE; iIndex++)
    {
        format(szFileStr, sizeof(szFileStr), "%f|%f|%f|%f|%f|%f|%f|%f|%d|%d\r\n",
            varCarSale[iIndex][CSVehSpawn][0],
            varCarSale[iIndex][CSVehSpawn][1],
            varCarSale[iIndex][CSVehSpawn][2],
            varCarSale[iIndex][CSVehSpawn][3],
            varCarSale[iIndex][VehSpawn][0],
            varCarSale[iIndex][VehSpawn][1],
            varCarSale[iIndex][VehSpawn][2],
            varCarSale[iIndex][VehSpawn][3],
            varCarSale[iIndex][CSVehCost],
            varCarSale[iIndex][CSVehModel]);
        fwrite(fHandle, szFileStr);
    }
    //print("[script] Car Sale Saved Successfully . . .");
    return fclose(fHandle);
}
Reply


Messages In This Thread
Coches en venta. - by M@ty - 15.09.2015, 01:59
Re: Coches en venta. - by MaRcOsWeB - 15.09.2015, 20:04
Respuesta: Re: Coches en venta. - by M@ty - 15.09.2015, 20:39
Re: Coches en venta. - by MaRcOsWeB - 15.09.2015, 23:31
Respuesta: Re: Coches en venta. - by M@ty - 16.09.2015, 01:43
Re: Coches en venta. - by MaRcOsWeB - 16.09.2015, 21:49
Respuesta: Re: Coches en venta. - by M@ty - 16.09.2015, 22:31
Re: Coches en venta. - by MaRcOsWeB - 17.09.2015, 02:13
Respuesta: Re: Coches en venta. - by M@ty - 17.09.2015, 03:17

Forum Jump:


Users browsing this thread: 4 Guest(s)