08.11.2010, 12:35
Hi there.
I want the code below to be posted as many times as it is files in the folder Vehicles (1 time is only Vehicle_1.ini 2 times if Vehicle_1.ini and Vehicle_2.ini exists and so on) and have the right stuff for all of it, is there an easy way to do this? (exept from making the codes several times)
I want the code below to be posted as many times as it is files in the folder Vehicles (1 time is only Vehicle_1.ini 2 times if Vehicle_1.ini and Vehicle_2.ini exists and so on) and have the right stuff for all of it, is there an easy way to do this? (exept from making the codes several times)
Code:
new vehfile1[256]; format(vehfile1, sizeof(vehfile1), "Vehicles/Vehicle_1.ini"); if(dini_Exists(vehfile1)) { new VehInfo1; VehInfo1 = dini_Int(vehfile1, "Owner"); new VehInfo2; VehInfo2 = dini_Int(vehfile1, "Faction"); new VehInfo3; VehInfo3 = dini_Int(vehfile1, "X"); new VehInfo4; VehInfo4 = dini_Int(vehfile1, "Y"); new VehInfo5; VehInfo5 = dini_Int(vehfile1, "Z"); new VehInfo6; VehInfo6 = dini_Int(vehfile1, "Zangle"); new VehInfo7; VehInfo7 = dini_Int(vehfile1, "Locked"); new VehInfo8; VehInfo8 = dini_Int(vehfile1, "Plate"); new VehInfo9; VehInfo9 = dini_Int(vehfile1, "Model"); new VehInfo10; VehInfo10 = dini_Int(vehfile1, "Color1"); new VehInfo11; VehInfo11 = dini_Int(vehfile1, "Color2"); CreateVehicle(VehInfo9, VehInfo3, VehInfo4, VehInfo5, VehInfo6, VehInfo10, VehInfo11, 10800); print("Vehicle 1 initiated"); }