SA-MP Forums Archive
Vehicle OwnerShip System.. i m fed up!! - 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 System.. i m fed up!! (/showthread.php?tid=373436)



Vehicle OwnerShip System.. i m fed up!! - CROSS_Hunter - 30.08.2012

i wanted to use this vehicle owenrship system Vehicle

it uses MySQL and INT at the same time but... i just uncomment the define my sql so the FS works with the SII version but the problem is that it saves and saves the cars but never loads them on server restart never!

this is how it loads the cas but i see it doesnt load cuz none of what is isaid in
pawn Code:
printf(blahblah)
nothing appears in server.exe

pawn Code:
stock LoadPVehicles()
{
    for(new i = 0; i < MAX_BUYABLE_VEH; ++i)
    {
        new
            vFile[15];

        format(vFile, sizeof(vFile), "%d.ini", i);

        if(INI_Exist(vFile))
        {
            INI_Open(vFile);

            print("\n=============================================================\n");
            vInfo[i][vModel] = INI_ReadInt("Model");        printf("Model:\t\t%i", vInfo[i][vModel]);
            vInfo[i][vColor1] = INI_ReadInt("Color1");      printf("Color 1:\t%i", vInfo[i][vColor1]);
            vInfo[i][vColor2] = INI_ReadInt("Color2");      printf("Color 2:\t%i", vInfo[i][vColor2]);
            vInfo[i][vPrice] = INI_ReadInt("Price");        printf("Price:\t\t$%i", vInfo[i][vPrice]);
            INI_ReadString(vInfo[i][vOwner], "Owner", 24);  printf("Owner:\t\t%s", vInfo[i][vOwner]);
            vInfo[i][vPosX] = INI_ReadFloat("vPosX");       printf("Spawn X:\t%f", vInfo[i][vPosX]);
            vInfo[i][vPosY] = INI_ReadFloat("vPosY");       printf("Spawn Y:\t%f", vInfo[i][vPosY]);
            vInfo[i][vPosZ] = INI_ReadFloat("vPosZ");       printf("Spawn Z:\t%f", vInfo[i][vPosZ]);
            vInfo[i][vPosA] = INI_ReadFloat("vPosA");       printf("Spawn A:\t%f", vInfo[i][vPosA]);
            INI_ReadString(vInfo[i][vPlate], "Plate", 32);  printf("Plate:\t\t%s", vInfo[i][vPlate]);
            vInfo[i][vPaintJ] = INI_ReadInt("PaintJ");      printf("PaintJ:\t\t%i", vInfo[i][vPaintJ]);
            vInfo[i][vLocked] = INI_ReadInt("Locked");      printf("Locked:\t\t%i", vInfo[i][vLocked]);

            vMods[i][0] = INI_ReadInt("vMod1");             printf("Mod 1:\t\t%i", vMods[i][0]);
            vMods[i][1] = INI_ReadInt("vMod2");             printf("Mod 2:\t\t%i", vMods[i][1]);
            vMods[i][2] = INI_ReadInt("vMod3");             printf("Mod 3:\t\t%i", vMods[i][2]);
            vMods[i][3] = INI_ReadInt("vMod4");             printf("Mod 4:\t\t%i", vMods[i][3]);
            vMods[i][4] = INI_ReadInt("vMod5");             printf("Mod 5:\t\t%i", vMods[i][4]);
            vMods[i][5] = INI_ReadInt("vMod6");             printf("Mod 6:\t\t%i", vMods[i][5]);
            vMods[i][6] = INI_ReadInt("vMod7");             printf("Mod 7:\t\t%i", vMods[i][6]);
            vMods[i][7] = INI_ReadInt("vMod8");             printf("Mod 8:\t\t%i", vMods[i][7]);
            vMods[i][8] = INI_ReadInt("vMod9");             printf("Mod 9:\t\t%i", vMods[i][8]);
            vMods[i][9] = INI_ReadInt("vMod10");            printf("Mod 10:\t\t%i", vMods[i][9]);
            vMods[i][10] = INI_ReadInt("vMod11");           printf("Mod 11:\t\t%i", vMods[i][10]);
            vMods[i][11] = INI_ReadInt("vMod12");           printf("Mod 12:\t\t%i", vMods[i][11]);
            print("\n=============================================================\n");

            new
                vCarID = CreateVehicle(vInfo[i][vModel], vInfo[i][vPosX], vInfo[i][vPosY], vInfo[i][vPosZ], vInfo[i][vPosA], vInfo[i][vColor1], vInfo[i][vColor2], 500000);
            SetVehicleNumberPlate(vCarID, vInfo[i][vPlate]);
            ChangeVehiclePaintjob(vCarID, vInfo[i][vPaintJ]);

            for(new iMod = 0; iMod < MAX_VEH_MODS; ++iMod)
            {
                if(vMods[vCarID][iMod] > 0)
                {
                    AddVehicleComponent(vCarID, vMods[vCarID][iMod]);
                }
            }

            OwnedVeh(vCarID) = i;

            ++ Total_Veh_Created;

            INI_Close();
        }
    }
    printf("** A total of: \"%i\" vehicle(s) were loaded!", Total_Veh_Created);

    print("\n=============================================================");
    print("Dynamic Vehicle Ownership By: [U]214 - .INI Version Loaded...");
    print("=============================================================\n");
    return 1;
}



Re: Vehicle OwnerShip System.. i m fed up!! - playbox12 - 30.08.2012

Search LoadPVehicles in your script. Does it get called anywhere besides the funtion itself?


Re: Vehicle OwnerShip System.. i m fed up!! - CROSS_Hunter - 30.08.2012

No,Just..

pawn Code:
public OnFilterScritInit()



Re: Vehicle OwnerShip System.. i m fed up!! - CROSS_Hunter - 01.09.2012

guys i need help here