SA-MP Forums Archive
Vehicle Ownership - 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: Vehicle Ownership (/showthread.php?tid=355912)



Vehicle Ownership - Muhamed.pwn - 01.07.2012

Hello..

I've downloaded a Vehicle Ownership from here and edited it !
Everything works perfect in my Gamemode execpt one thing. When I buy a car , it creates a file 2 times , whit one file is everything correct but in the other one all values are "0". And when I start my server it won't load , stucks on this file. -.-

I've checked LoadPrivVeh and SavePVeh and have found nothing.

P.S. I'm using SII for it.

Hope you can help me.

Thank you.


Re: Vehicle Ownership - Hawky133 - 01.07.2012

Hello.

Please could you provide some code? We cannot diagnose your code (which is creating those problems) if we cannot see it.


Respuesta: Vehicle Ownership - Muhamed.pwn - 02.07.2012

Here you have the saving code.
It creates files like this: 0 , 1, 2 ... and then creates a fi,e named 369.

pawn Код:
stock SavePrivVeh(iVehicleID)
{
    new
        iStr[15];

    format(iStr, sizeof(iStr), "Vozila/%d.ini", iVehicleID);
    if(INI_Open(iStr))
    {
        INI_WriteInt("Model", vInfo[iVehicleID][vModel]);
        INI_WriteInt("Color1", vInfo[iVehicleID][vColor1]);
        INI_WriteInt("Color2", vInfo[iVehicleID][vColor2]);
        INI_WriteInt("Price", vInfo[iVehicleID][vPrice]);
        INI_WriteString("Owner", vInfo[iVehicleID][vOwner]);
        INI_WriteFloat("vPosX", vInfo[iVehicleID][vPosX]);
        INI_WriteFloat("vPosY", vInfo[iVehicleID][vPosY]);
        INI_WriteFloat("vPosZ", vInfo[iVehicleID][vPosZ]);
        INI_WriteFloat("vPosA", vInfo[iVehicleID][vPosA]);
        INI_WriteString("Plate", vInfo[iVehicleID][vPlate]);
        INI_WriteInt("PaintJ", vInfo[iVehicleID][vPaintJ]);
        INI_WriteInt("Locked", vInfo[iVehicleID][vLocked]);

        INI_Save();
        INI_Close();
    }
    return 1;
}



Re: Vehicle Ownership - miikeyy45 - 02.07.2012

The code above is the dealership information..