Big Problem, Problems with Vehicle[ID]
#1

Ok so recently I changed the max number of owned cars in my server from two to six. But now I have a problem, the Vehicle ID's don't seem to work correctly (read bellow for what I mean).

So I have it where all Owned Cars Load their Vehicle ID as the the Vehicle Profiles Number (EX: 13.ini the ID (GetPlayerVehicleID) should be 13), but since I changed the max number of owned cars it doesn't work... Like it ignores the setting of the ID and just assigns it normally (in order of how it loads in the GM). This problem only started after I changed the system to six maximum owned cars, it worked before just fine.

Whats wrong?!?

This may help:
pawn Код:
public LoadCar()
{
    new file[26];
    for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
    {
        format(file, sizeof(file),"LARP/Vehicles/%d.ini", idx)
        if(dini_Exists(file))
        {
            CarInfo[idx][cModel] = dini_Int(file,"Model");
            CarInfo[idx][cLocationx] = dini_Float(file,"Location_X");
            CarInfo[idx][cLocationy] = dini_Float(file,"Location_Y");
            CarInfo[idx][cLocationz] = dini_Float(file,"Location_Z");
            CarInfo[idx][cAngle] = dini_Float(file,"Angle");
            CarInfo[idx][cColorOne] = dini_Int(file,"Color_1");
            CarInfo[idx][cColorTwo] = dini_Int(file,"Color_2");
            strmid(CarInfo[idx][cOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
            CarInfo[idx][cOwned] = dini_Int(file,"Owned");
            CarInfo[idx][cLock] = dini_Int(file,"Locked");
            CarInfo[idx][cPaintjob] = dini_Int(file,"Paintjob");
            CarInfo[idx][cVirWorld] = dini_Int(file,"VirtualWorld");
            CarInfo[idx][cComponent0] = dini_Int(file,"Component0");
            CarInfo[idx][cComponent1] = dini_Int(file,"Component1");
            CarInfo[idx][cComponent2] = dini_Int(file,"Component2");
            CarInfo[idx][cComponent3] = dini_Int(file,"Component3");
            CarInfo[idx][cComponent4] = dini_Int(file,"Component4");
            CarInfo[idx][cComponent5] = dini_Int(file,"Component5");
            CarInfo[idx][cComponent6] = dini_Int(file,"Component6");
            CarInfo[idx][cComponent7] = dini_Int(file,"Component7");
            CarInfo[idx][cComponent8] = dini_Int(file,"Component8");
            CarInfo[idx][cComponent9] = dini_Int(file,"Component9");
            CarInfo[idx][cComponent10] = dini_Int(file,"Component10");
            CarInfo[idx][cComponent11] = dini_Int(file,"Component11");
            CarInfo[idx][cComponent12] = dini_Int(file,"Component12");
            CarInfo[idx][cComponent13] = dini_Int(file,"Component13");
            CarInfo[idx][cCode] = dini_Int(file,"SecurityCode");
        }
    }
pawn Код:
LoadCar();
    new string2[64];
    for(new h = 1; h < sizeof(CarInfo); h++)
    {
        format(string2, sizeof(string2), "LARP/Vehicles/%d.ini",h);
        if(dini_Exists(string2))
        {
            ownedcar[h] = AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
            if(CarInfo[h][cPaintjob] != 999)
            {
                ChangeVehiclePaintjob(h, CarInfo[h][cPaintjob]);
            }
            SetVehicleVirtualWorld(h, CarInfo[h][cVirWorld]);
            SetVehicleModifications(h);
        }
    }
*I REALLY need this fixed, it's a major problem in my server. I will +1 Rep (for those who care).*

Thanks in advance: jakejohnsonusa
Reply
#2

Bump...

Basically I need to figure out how to assign the variable m for the vehicle ID. The variable m changes for every car (It's just the # of the order in the Vehicle Profiles folder in the scriptfiles).


PLEASE THIS IS A HUGE PROBLEM!

-Thanks: jakejohnsonusa
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)