Help with open carslot problem.
#1

Okay so i am experiencing some problems with loading of house vehicles. I had this:
pawn Код:
new vid, CarSlot, pName[MAX_PLAYER_NAME];//, string2[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    CarSlot = House_GetFreeCarSlot(HouseID);
    printf("House_AddVehicle::CarSlot = %d", CarSlot);
    if (CarSlot != 0)
    {
        vid = Vehicle_Create(cModel, cx, cy, cz, crot, Col2, Col1, 600);
        printf("House_AddVehicle::vid= %d", vid);
        AHouseData[HouseID][VehicleIDs][CarSlot] = vid;
        printf("House_AddVehicle::AHouseData[%d][VehicleIDs][%d]= %d", HouseID, CarSlot, AHouseData[HouseID][VehicleIDs][CarSlot]);
        AVehicleData[vid][CarModel] = cModel;
        AVehicleData[AHouseData[HouseID][VehicleIDs][CarSlot]][SaveID] = CarID;
        // Save the spawn-data of the vehicle
        AVehicleData[vid][SpawnX] = cx;
        AVehicleData[vid][SpawnY] = cy;
        AVehicleData[vid][SpawnZ] = cz;
        AVehicleData[vid][SpawnRot] = crot;
        AVehicleData[vid][Color1] = Col1;
        AVehicleData[vid][Color2] = Col2;
        // Apply the given parameters to the vehicle
        AVehicleData[vid][FuelData] = MaxFuel;
        AVehicleData[vid][Owned] = true;
        ChangeVehicleColor(vid, AVehicleData[vid][Color1], AVehicleData[vid][Color2]);
        format(AVehicleData[vid][Owner], 24, pName);
        AVehicleData[vid][BelongsToHouse] = HouseID;

        print("Vehicle loaded");
    }
    else
    {
        print ("No free carslot");// No free carslot was found, return 0
        return 0;
    }

    // Exit the function and return the vehicle-id
    return vid;
}
But that always says there is no free car slot for some reason. Anyone knows why?
Reply


Messages In This Thread
Help with open carslot problem. - by thimo - 02.02.2014, 10:04
Re: Help with open carslot problem. - by Konstantinos - 02.02.2014, 10:07
Re: Help with open carslot problem. - by thimo - 02.02.2014, 10:09
Re: Help with open carslot problem. - by Konstantinos - 02.02.2014, 10:34
Re: Help with open carslot problem. - by thimo - 02.02.2014, 10:58

Forum Jump:


Users browsing this thread: 1 Guest(s)