SA-MP Forums Archive
Need help with function. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with function. (/showthread.php?tid=259123)



Need help with function. - CoaPsyFactor - 03.06.2011

Ok I can't figure it out, but always when I try to call this function server call it, but then just like the function don't return any value

pawn Код:
public LoadSpeedCams(){
    new String[128], Split_String[5][11], SC;
    if(!dini_Exists("speedcams.txt")){
        return 1;
    }
    SC = 0;
    new File:LoadSC = fopen("speedcams.txt", io_read);
    while(fread(LoadSC, String)){
        split(String, Split_String, ',');
        SpeedCams[SC][scX] = floatstr(Split_String[0]);
        SpeedCams[SC][scY] = floatstr(Split_String[1]);
        SpeedCams[SC][scZ] = floatstr(Split_String[2]);
        SpeedCams[SC][scMax_Speed] = strval(Split_String[3]);
        SC++;
    }
    fclose(LoadSC);
    return 1;
}
when i put it in OnGameModeInit, I call this function first, and then it won't call any other function, can any one help me


Re: Need help with function. - CoaPsyFactor - 03.06.2011

smart


Re: Need help with function. - CoaPsyFactor - 03.06.2011

hm look like, it don't split good, i mean it stops after 2nd split :S


Re: Need help with function. - CoaPsyFactor - 03.06.2011

sorry for 3ple post, but I realized when speedcams.txt is empty it work just fine :S