PDA

View Full Version : [HELP] Y_Ini load race from second time


Luca12
12/03/2015, 01:55 PM
Hello everyone. So I created dynamic event race and when I load race from first time the race doens't load I mean the data from the ini file. But when I load that the same race again(second time) the race is loaded fine so what could cause this problem. Thanks.

This is loading code from /loadrace command

inline loadracedata(string:name[],string:value[])
{
new scps[15];
INI_String("ImeUtrke",UtrkaInfo[nazivUtrke],128);
INI_Int("BrojCP",UtrkaInfo[utrkaBrojCP]);
INI_String("Rekorder",UtrkaInfo[utrkaRekorder],128);
INI_Int("RekordMinuti",UtrkaInfo[utrkaRekordMinuti]);
INI_Int("RekordSekunde",UtrkaInfo[utrkaRekordSekunde]);
INI_Int("Krugova",UtrkaInfo[utrkaKrugova]);
INI_Int("Vozila",UtrkaInfo[utrkaVozila]);
INI_Int("Zadnji_CP",UtrkaInfo[utrkaZadnjiCP]);
INI_Float("CP_Radius",UtrkaInfo[CPRadius]);
for(new cpsrc = 1; cpsrc <= UtrkaInfo[utrkaBrojCP]; cpsrc++)
{
format(scps,sizeof(scps),"CP_%d_PosX",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpX]);

format(scps,sizeof(scps),"CP_%d_PosY",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpY]);

format(scps,sizeof(scps),"CP_%d_PosZ",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpZ]);

format(scps,sizeof(scps),"CP_%d_Prolaz",cpsrc);
INI_Int(scps,CPInfo[cpsrc][utrkaProlaz]);

format(scps,sizeof(scps),"CP_%d_Krug",cpsrc);
INI_Int(scps,CPInfo[cpsrc][utrkaKrug]);
}
}
INI_ParseFile(FolderRaces(params),"loadracedata");

JuanStone
12/03/2015, 02:24 PM
I cannot understand, forgive me i am not the best in English but I do the attempt, you could go the full command ? The problem is that you need to use the command twice to load a race ?.

Luca12
19/03/2015, 04:40 PM
anyone? Thanks

Luca12
23/03/2015, 09:19 AM
anyone? thanks. I think that maybe problem is in the loop for(new cpsrc = 1; cpsrc <= UtrkaInfo[utrkaBrojCP]; cpsrc++)

Luca12
24/03/2015, 01:51 PM
Anyone? Thanks

Misiur
24/03/2015, 01:55 PM
Please, indent correctly. Well, if you suspect so, try it out!
for(new cpsrc = 0; cpsrc < UtrkaInfo[utrkaBrojCP]; cpsrc++)

If it doesn't work, please show the ini file.

Luca12
28/03/2015, 01:33 PM
So I try that and it load race from second time so this is the ini file

[Utrka Informacije]
CP_1_Krug = 0
CP_1_Prolaz = 0
CP_1_PosZ = 7.371500
CP_1_PosY = 840.305480
CP_1_PosX = 797.354980
ImeUtrke = LV Rudnik Offroad
CP_Radius = 10.000000
CP_2_Krug = 0
CP_2_Prolaz = 0
CP_2_PosZ = -1.644024
CP_2_PosY = 778.262695
CP_2_PosX = 761.050476
CP_3_Krug = 0
CP_3_Prolaz = 0
CP_3_PosZ = -10.097424
CP_3_PosY = 747.201965
CP_3_PosX = 661.296325
CP_4_Krug = 0
CP_4_Prolaz = 0
CP_4_PosZ = -30.284835
CP_4_PosY = 857.514953
CP_4_PosX = 495.290466
CP_5_Krug = 0
CP_5_Prolaz = 0
CP_5_PosZ = -21.461559
CP_5_PosY = 955.640808
CP_5_PosX = 539.030578
CP_6_Krug = 0
CP_6_Prolaz = 0
CP_6_PosZ = -13.199134
CP_6_PosY = 983.145019
CP_6_PosX = 679.583129
CP_7_Krug = 0
CP_7_Prolaz = 0
CP_7_PosZ = -5.688694
CP_7_PosY = 993.413513
CP_7_PosX = 552.518066
CP_8_Krug = 0
CP_8_Prolaz = 0
CP_8_PosZ = 5.414980
CP_8_PosY = 1003.559326
CP_8_PosX = 667.401855
CP_9_Krug = 0
CP_9_Prolaz = 0
CP_9_PosZ = -1.232622
CP_9_PosY = 875.017761
CP_9_PosX = 778.182373
CP_10_Krug = 1
CP_10_Prolaz = 0
CP_10_PosZ = 1.048412
CP_10_PosY = 792.244750
CP_10_PosX = 771.153747
CP_11_Krug = 0
CP_11_Prolaz = 0
CP_11_PosZ = -11.432757
CP_11_PosY = 745.726440
CP_11_PosX = 651.896972
CP_12_Krug = 0
CP_12_Prolaz = 0
CP_12_PosZ = -30.259405
CP_12_PosY = 855.508300
CP_12_PosX = 495.230377
CP_13_Krug = 0
CP_13_Prolaz = 0
CP_13_PosZ = -26.574710
CP_13_PosY = 941.523132
CP_13_PosX = 515.611328
CP_14_Krug = 0
CP_14_Prolaz = 0
CP_14_PosZ = -13.159237
CP_14_PosY = 977.772399
CP_14_PosX = 679.384460
CP_15_Krug = 0
CP_15_Prolaz = 0
CP_15_PosZ = -6.384762
CP_15_PosY = 992.984802
CP_15_PosX = 548.454650
CP_16_Krug = 0
CP_16_Prolaz = 0
CP_16_PosZ = 5.419858
CP_16_PosY = 1001.951171
CP_16_PosX = 672.011535
CP_17_Krug = 0
CP_17_Prolaz = 0
CP_17_PosZ = 5.431103
CP_17_PosY = 931.311706
CP_17_PosX = 758.210510
CP_18_Krug = 1
CP_18_Prolaz = 0
CP_18_PosZ = 1.368028
CP_18_PosY = 794.473937
CP_18_PosX = 772.013122
CP_19_Krug = 0
CP_19_Prolaz = 0
CP_19_PosZ = -11.240496
CP_19_PosY = 749.461059
CP_19_PosX = 651.961914
CP_20_Krug = 0
CP_20_Prolaz = 0
CP_20_PosZ = -30.997333
CP_20_PosY = 862.175109
CP_20_PosX = 494.780273
CP_21_Krug = 0
CP_21_Prolaz = 0
CP_21_PosZ = -20.565059
CP_21_PosY = 957.808349
CP_21_PosX = 545.695739
CP_22_Krug = 0
CP_22_Prolaz = 0
CP_22_PosZ = -13.187022
CP_22_PosY = 981.592895
CP_22_PosX = 682.761901
CP_23_Krug = 0
CP_23_Prolaz = 0
CP_23_PosZ = -4.129530
CP_23_PosY = 996.088317
CP_23_PosX = 560.834228
CP_24_Krug = 0
CP_24_Prolaz = 0
CP_24_PosZ = 5.424979
CP_24_PosY = 976.357849
CP_24_PosX = 729.649658
CP_25_Krug = 1
CP_25_Prolaz = 0
CP_25_PosZ = -0.478008
CP_25_PosY = 782.607299
CP_25_PosX = 768.118041
CP_26_Krug = 0
CP_26_Prolaz = 0
CP_26_PosZ = -12.473561
CP_26_PosY = 745.924621
CP_26_PosX = 638.693603
CP_27_Krug = 0
CP_27_Prolaz = 0
CP_27_PosZ = -30.717237
CP_27_PosY = 862.623168
CP_27_PosX = 491.161041
CP_28_Krug = 0
CP_28_Prolaz = 0
CP_28_PosZ = -21.514677
CP_28_PosY = 954.671813
CP_28_PosX = 538.604003
CP_29_Krug = 0
CP_29_Prolaz = 0
CP_29_PosZ = -13.134588
CP_29_PosY = 984.473999
CP_29_PosX = 674.024169
CP_30_Krug = 0
CP_30_Prolaz = 0
CP_30_PosZ = -4.049338
CP_30_PosY = 995.566467
CP_30_PosX = 561.472656
CP_31_Krug = 0
CP_31_Prolaz = 0
CP_31_PosZ = 5.428658
CP_31_PosY = 952.151367
CP_31_PosX = 747.896789
CP_32_Krug = 1
CP_32_Prolaz = 0
CP_32_PosZ = 3.266227
CP_32_PosY = 807.375793
CP_32_PosX = 776.859436
CP_33_Krug = 0
CP_33_Prolaz = 0
CP_33_PosZ = -12.109542
CP_33_PosY = 746.936523
CP_33_PosX = 642.742309
CP_34_Krug = 0
CP_34_Prolaz = 0
CP_34_PosZ = -30.459318
CP_34_PosY = 861.159484
CP_34_PosX = 487.857330
CP_35_Krug = 0
CP_35_Prolaz = 0
CP_35_PosZ = -21.419771
CP_35_PosY = 957.120117
CP_35_PosX = 539.391784
CP_36_Krug = 0
CP_36_Prolaz = 0
CP_36_PosZ = -13.193315
CP_36_PosY = 984.234985
CP_36_PosX = 677.738281
CP_37_Krug = 0
CP_37_Prolaz = 0
CP_37_PosZ = -4.874122
CP_37_PosY = 997.059997
CP_37_PosX = 555.836853
CP_38_Krug = 0
CP_38_Prolaz = 0
CP_38_PosZ = 5.404660
CP_38_PosY = 933.747558
CP_38_PosX = 760.355041
CP_39_Krug = 1
CP_39_Prolaz = 0
CP_39_PosZ = 0.829212
CP_39_PosY = 790.610168
CP_39_PosX = 770.965576
CP_40_Krug = 0
CP_40_Prolaz = 0
CP_40_PosZ = -11.629753
CP_40_PosY = 748.561828
CP_40_PosX = 647.959777
CP_41_Krug = 0
CP_41_Prolaz = 0
CP_41_PosZ = -30.348001
CP_41_PosY = 859.288330
CP_41_PosX = 493.474853
CP_42_Krug = 0
CP_42_Prolaz = 0
CP_42_PosZ = -22.010553
CP_42_PosY = 955.276245
CP_42_PosX = 535.007568
CP_43_Krug = 0
CP_43_Prolaz = 0
CP_43_PosZ = -13.209620
CP_43_PosY = 983.722900
CP_43_PosX = 679.862365
CP_44_Krug = 0
CP_44_Prolaz = 0
CP_44_PosZ = -4.741230
CP_44_PosY = 996.155822
CP_44_PosX = 557.079528
CP_45_Krug = 0
CP_45_Prolaz = 0
CP_45_PosZ = 5.425684
CP_45_PosY = 930.962036
CP_45_PosX = 759.486755
CP_46_Krug = 0
CP_46_Prolaz = 0
CP_46_PosZ = 5.421287
CP_46_PosY = 826.577636
CP_46_PosX = 778.740966
Zadnji_CP = 46
Vozila = 1
Krugova = 5
BrojCP = 46
RekordSekunde = 59
RekordMinuti = 59
Rekorder = Nitko

Luca12
02/04/2015, 02:57 PM
anyone. When I load the race from the first time cp's floats are

[14:32:10] CPX = 0.0000
[14:32:10] CPY = 0.0000
[14:32:10] CPZ = 0.0000 // this is just cordinates from first cp x y z and the others cp are the same like this. But when I load the race again it load cordinates the way it should load from the first time. Thanks