WHat is wrong in this code?
#7

[QUOTE=Kyle_Olsen;946302]Okey, this is my vehicle initation process...

pawn Код:
stock InitVehicles()
{
print("Initiating vehicle initiation process");
    new Vehicle[16];
    for(new i = 0; i < 500; i++)
    {
   
        format(Vehicle, sizeof(Vehicle), "V_%d", i);
        if(djIsSet(VEHICLES_FILE, Vehicle) )
        {
       
            format(Vehicle, sizeof(Vehicle), "V_%d/PosX", i);
            Vehicles[i][CarPosX] = djFloat(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/PosY", i);
            Vehicles[i][CarPosY] = djFloat(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", i);
            Vehicles[i][CarPosZ] = djFloat(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", i);
            Vehicles[i][CarZAngle] = djFloat(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Model", i);
            Vehicles[i][CarModel] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Owner", i);
            Vehicles[i][Owner] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Plate", i);
            Vehicles[i][Plate] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Col1", i);
            Vehicles[i][CarColour1] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Col2", i);
            Vehicles[i][CarColour2] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Group", i);
            Vehicles[i][CarGroup] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Locked", i);
            Vehicles[i][Locked] = djInt(VEHICLES_FILE, Vehicle, true);
           
            format(Vehicle, sizeof(Vehicle), "V_%d/Alarm", i);
            Vehicles[i][Alarm] = djInt(VEHICLES_FILE, Vehicle, true);
           
            CarCount++;
           
            if(Vehicles[i][CarModel] != 537 && Vehicles[i][CarModel] != 538 && Vehicles[i][CarModel] != 569 && 570 && Vehicles[i][CarModel] != 590 )
            {
                Vehicles[i][GameID] = AddStaticVehicleEx(Vehicles[i][CarModel], Vehicles[i][CarPosX], Vehicles[i][CarPosY], Vehicles[i][CarPosZ], Vehicles[i][CarZAngle], Vehicles[i][CarColour1], Vehicles[i][CarColour2], 3600 );
                SetVehicleNumberPlate(i, Vehicles[i][Plate]);
                new engine,lights,alarm,doors,bonnet,boot,objective;
                GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
                SetVehicleParamsEx(i,engine,lights,Vehicles[i][Alarm],Vehicles[i][Locked],bonnet,boot,objective);
            }
           
            printf( "[system] InitVehicles(): Vehicle %d has spawned (spawned from %s).", i, VEHICLES_FILE);
     }
     else
     {
          print("Cars Not Found!")
     }
 }
}
the indentation got messed up so tidy it up before you use it.


See what i added at the bottom of the script, if it prints that in the console, then you know its djIsSet

Why did you remove the MAX_VEHICLES define? just use it for simplicity.


PS: djInt is for integers. You should change that.
Reply


Messages In This Thread
WHat is wrong in this code? - by Kyle_Olsen - 07.12.2010, 13:46
Re: WHat is wrong in this code? - by DVDK - 07.12.2010, 15:43
Re: WHat is wrong in this code? - by Toreno - 07.12.2010, 16:45
Re: WHat is wrong in this code? - by Kyle_Olsen - 08.12.2010, 03:34
Re: WHat is wrong in this code? - by Kyle_Olsen - 09.12.2010, 03:48
Re: WHat is wrong in this code? - by 6d - 09.12.2010, 03:58
Re: WHat is wrong in this code? - by Hal - 09.12.2010, 04:04

Forum Jump:


Users browsing this thread: 1 Guest(s)