Jump to content

problema jobs cica


hanako

Recommended Posts

asa ma baieti, va salut cu stima si respect.

am intampinat si eu o problema, deci

am 13 joburi pe server, ok? primele 2 job-uri merge, insa celelalte da cu id pe -1, adica daca job-ul pe care-l iau are id 4, mie o sa-mi dea id 3 la setarea job-ului.

comanda /getjob

CMD:getjob(playerid, params[]) {
    new jobid;
    if(PlayerInfo[playerid][pJob] >= 1) return SCM(playerid, -1, "Deja ai un job, foloseste /quitjob.");
    if(PlayerInfo[playerid][pLevel] < DynamicJobs[jobid][jobLevel]) return SCM(playerid, -1, "Nu detii nivelul necesar pentru a te angaja la jobul respectiv!");
    for(new j = 0; j < sizeof(DynamicJobs); j++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, DynamicJobs[j][jPosX], DynamicJobs[j][jPosY], DynamicJobs[j][jPosZ]))
        {
            PlayerInfo[playerid][pJob] = j; pUpdateInt(playerid, "Job", j);
            SCMf(playerid, COLOR_YELLOW, "(JOB): {ffffff}Felicitari! Noul tau job este %s.", DynamicJobs[j][jobName]);
        }
    }
    return true; }

functia loaddynamicjobs:

 

function LoadDynamicJobs() {
    //jobss = cache_num_rows();
    for(new i = 1; i <= Iter_Add(Jobs, i); i++) {
        gString[0] = (EOS);
        new j = i - 1;
        DynamicJobs[i][jobID]                 = cache_get_field_content_int(j, "jobID");
        DynamicJobs[i][jOwned]                = cache_get_field_content_int(j, "Owned");
        cache_get_field_content(j, "jobName", DynamicJobs[i][jobName], SQL, 130);
        DynamicJobs[i][jobLevel]               = cache_get_field_content_int(j, "jobLevel");
        DynamicJobs[i][jPosX]                 = cache_get_field_content_float(j, "PosX");
           DynamicJobs[i][jPosY]                 = cache_get_field_content_float(j, "PosY");
        DynamicJobs[i][jPosZ]                 = cache_get_field_content_float(j, "PosZ");
        cache_get_field_content(j, "JobOwner", DynamicJobs[i][jobOwner], SQL, 64);
        DynamicJobs[i][jBuyPrice]                = cache_get_field_content_int(j, "BuyPrice");
        DynamicJobs[i][jTill]                      = cache_get_field_content_int(j, "Till");
        DynamicJobs[i][jPickupID]                = cache_get_field_content_int(j, "PickupID");
        cache_get_field_content(j, "Message", DynamicJobs[i][jMessage], SQL, 130);

        if(DynamicJobs[i][jBuyPrice] >= 1) {
            DestroyDynamic3DTextLabel(DynamicJobs[i][jLabelID]);
            format(gString, sizeof gString, "{FFD700}ID: {ffffff}%d{FFD700}\n%s\nName: {ffffff}%s{FFD700}\nMinim Level: {ffffff}%d{FFD700}\nOwner: {ffffff}%s{FFD700}\n{FFD700}[/getjob] - To get the job\nPrice: {ffffff}$%s\n{FFD700}[/buyjob] - For buy the job{ffffff}", DynamicJobs[i][jobID], DynamicJobs[i][jMessage], DynamicJobs[i][jobName], DynamicJobs[i][jobLevel], DynamicJobs[i][jobOwner], FormatNumber(DynamicJobs[i][jBuyPrice])); 
            DynamicJobs[i][jLabelID] = CreateDynamic3DTextLabel(gString, -1, DynamicJobs[i][jPosX], DynamicJobs[i][jPosY], DynamicJobs[i][jPosZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
        }
        if(DynamicJobs[i][jOwned] == 1)
        {
            DestroyDynamic3DTextLabel(DynamicJobs[i][jLabelID]);
            format(gString, sizeof gString, "{FFD700}ID: {ffffff}%d{FFD700}\n%s\nName: {ffffff}%s{FFD700}\nMinim Level: {ffffff}%d{FFD700}\nOwner: {ffffff}%s{FFD700}\n{FFD700}[/getjob] - To get the job", DynamicJobs[i][jobID], DynamicJobs[i][jMessage],DynamicJobs[i][jobName], DynamicJobs[i][jobLevel], DynamicJobs[i][jobOwner]); 
            DynamicJobs[i][jLabelID] = CreateDynamic3DTextLabel(gString, -1, DynamicJobs[i][jPosX], DynamicJobs[i][jPosY], DynamicJobs[i][jPosZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
        }
        DynamicJobs[i][jPickupID] = CreateDynamicPickup(1275, 23, DynamicJobs[i][jPosX], DynamicJobs[i][jPosY], DynamicJobs[i][jPosZ], 0, -1, -1, 15); pickups++;
    }
    printf("[LOADING] JOBS - %d", Iter_Count(Jobs));
    return true; }

[preciez ca este sistemul lui flint din gamemode-ul ala stoners, mi-a placut cum arata si am vrut sa-l editezi putin pana am dat de problema asta la care ma chinui aproximativ 7 ore sa o rezolv].

A, si in mysql_log apare asa ceva:

Log("16:09:39","cache_get_field_content_int",1,"invalid datatype",0);
Log("16:09:39","CMySQLResult::GetRowDataByName()",1,"invalid row index ('13') (Query: \"SELECT * FROM `jobs`\")",0);

 

Link to comment
Share on other sites

Salut, ai verificat in baza de date daca nu este un job lipsa in tabelul jobs sau unde le ai?

Iar in gamemode care job lipseste, pentru ca eu am inteles ca daca iei jobul 4 iti da defapt 3, asta inseamna ca daca iei 3 iti da 2 dar tu ai zis ca 1 si 2 ti le da bine, oricum cel mai probabil din baza de date lipseste id 3

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • WopsS locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.