Lio Posted May 14, 2018 Share Posted May 14, 2018 Username:Lio Problemă întâlnită:am facut comanda /jobs dar cand o execut in joc apare aiurea. Detalii despre problemă:imagine: https://imgur.com/a/Wspjqs2 Ce ai încercat să faci înainte să postezi?:am crezut ca este de la stringuri si le-am marit putin. Cod sursă (recomandat pastebin.com):https://pastebin.com/nvsuLwhb Alte detalii: Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 14, 2018 Administrator Share Posted May 14, 2018 poftim: CMD:jobs(playerid, params[]) { new string[1024], string2[1024]; strcat(string2, "Nume\tOras\tTip\n"); for(new j = 0; j < 10; j++) { if(strlen(JobData[j][jName]) >= 1 && j != 7) { format(string,sizeof(string), "%s\t%s\t%s\n",JobData[j][jName], JobData[j][jCity], JobData[j][jTip]); strcat(string2, string); } } ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_TABLIST_HEADERS, "Locuri de munca", string2, "Ok", "Cancel"); return 1; } www.liberty.mp Link to comment Share on other sites More sharing options...
Lio Posted May 14, 2018 Author Share Posted May 14, 2018 poftim: CMD:jobs(playerid, params[]) { new string[1024], string2[1024]; strcat(string2, "Nume\tOras\tTip\n"); for(new j = 0; j < 10; j++) { if(strlen(JobData[j][jName]) >= 1 && j != 7) { format(string,sizeof(string), "%s\t%s\t%s\n",JobData[j][jName], JobData[j][jCity], JobData[j][jTip]); strcat(string2, string); } } ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_TABLIST_HEADERS, "Locuri de munca", string2, "Ok", "Cancel"); return 1; } https://imgur.com/gjPF5nM si acum ce are Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 14, 2018 Administrator Share Posted May 14, 2018 Incearca if(strlen(JobData[j][jName]) >= 1) www.liberty.mp Link to comment Share on other sites More sharing options...
Lio Posted May 15, 2018 Author Share Posted May 15, 2018 (edited) Incearca if(strlen(JobData[j][jName]) >= 1) Oare problema este de aici: function LoadJob(){ new jobid, jobscount, tmp[180], string[200]; cache_get_data(rows, fields, handle); if(rows){ for(new i = 0; i < rows; i++){ jobscount++; cache_get_field_content(i, "JobID", tmp); jobid = strval(tmp); cache_get_field_content(i, "JobName", tmp); format(JobData[jobid][jName], 128, tmp); cache_get_field_content(i, "JobPosX", tmp); JobData[jobid][jPosX] = floatstr(tmp); cache_get_field_content(i, "JobPosY", tmp); JobData[jobid][jPosY] = floatstr(tmp); cache_get_field_content(i, "JobPosZ", tmp); JobData[jobid][jPosZ] = floatstr(tmp); cache_get_field_content(i, "JobTipe", tmp); format(JobData[jobid][jTip], 128, tmp); cache_get_field_content(i, "JobCity", tmp); format(JobData[jobid][jCity], 128, tmp); } } printf("Load jobs: %d", jobscount); return 1; } Decat primul si ultemele 3 joburi le afiseaza corect Edited May 15, 2018 by Lio Link to comment Share on other sites More sharing options...
Lio Posted May 17, 2018 Author Share Posted May 17, 2018 t/c - rezolvat Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 17, 2018 Administrator Share Posted May 17, 2018 Problema rezolvata. Locked www.liberty.mp Link to comment Share on other sites More sharing options...
Recommended Posts