Jump to content

Question

Posted

Salut tuturor, am o problema la gm-ul lui hpq123, mai exact la joburi, am pus in baza de date jobul facut dar nu mi-l arata in joc, am pus corect si la max jobs dar nu mil arata in dialog. Mai jos este comanda /jobs.

 

YCMD:jobs(playerid, params[], help) {
    
    if(JobWorking[playerid] == 1)
        return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta coamnda cand muncesti.");
    
    new szDialog2[1024], szTitle[50], xx, Owner[30];
    strcat(szDialog2, "Job name\tLevel\tOwner\tDistance\n");

    for(new j = 0; j < MAX_JOBS; j++) {
        if(strlen(JobInfo[j][jName]) > 1) {
            if(strcmp(JobInfo[j][jOwner], "None", true) == 0) {
                Owner = "{BC1D1D}-{FFFFFF}";
            } else format(Owner, sizeof(Owner), "%s", JobInfo[j][jOwner]);

            gString[0] = EOS;
            format(gString, sizeof(gString), "%s\t%d\t%s\t%0.2fm\n", JobInfo[j][jName],JobInfo[j][jLevel], Owner, GetPlayerDistanceFromPoint(playerid, JobInfo[j][jPosX],JobInfo[j][jPosY],JobInfo[j][jPosZ]));
            strcat(szDialog2, gString);
            xx++;
        }
    }
    format(szTitle, sizeof(szTitle), "Jobs: %d", xx);
    ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Cancel");
    return true;
}

function PlayersHaveJob(jobid) {
    new x;
    foreach(Player, i) {
        if(IsPlayerConnected(i) && IsPlayerLogged == 1) {
            if(PlayerInfo[pJob] == jobid) x++;
        }
    }
    return x;
}

3 answers to this question

Recommended Posts

  • 0
Posted
Acum 18 minute, alinutzu23 a spus:

Salut tuturor, am o problema la gm-ul lui hpq123, mai exact la joburi, am pus in baza de date jobul facut dar nu mi-l arata in joc, am pus corect si la max jobs dar nu mil arata in dialog. Mai jos este comanda /jobs.

 

YCMD:jobs(playerid, params[], help) {
    
    if(JobWorking[playerid] == 1)
        return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta coamnda cand muncesti.");
    
    new szDialog2[1024], szTitle[50], xx, Owner[30];
    strcat(szDialog2, "Job name\tLevel\tOwner\tDistance\n");

    for(new j = 0; j < MAX_JOBS; j++) {
        if(strlen(JobInfo[j][jName]) > 1) {
            if(strcmp(JobInfo[j][jOwner], "None", true) == 0) {
                Owner = "{BC1D1D}-{FFFFFF}";
            } else format(Owner, sizeof(Owner), "%s", JobInfo[j][jOwner]);

            gString[0] = EOS;
            format(gString, sizeof(gString), "%s\t%d\t%s\t%0.2fm\n", JobInfo[j][jName],JobInfo[j][jLevel], Owner, GetPlayerDistanceFromPoint(playerid, JobInfo[j][jPosX],JobInfo[j][jPosY],JobInfo[j][jPosZ]));
            strcat(szDialog2, gString);
            xx++;
        }
    }
    format(szTitle, sizeof(szTitle), "Jobs: %d", xx);
    ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Cancel");
    return true;
}

function PlayersHaveJob(jobid) {
    new x;
    foreach(Player, i) {
        if(IsPlayerConnected(i) && IsPlayerLogged == 1) {
            if(PlayerInfo[pJob] == jobid) x++;
        }
    }
    return x;
}

Vezi ca MAX_JOBS sa aibe +1 numarul de joburi pe care il ai in baza de date

YCMD:jobs(playerid, params[], help) 
{
    
    if(JobWorking[playerid] == 1)
        return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta coamnda cand muncesti.");
    
    new szDialog2[1024], szTitle[50], xx, Owner[30];
    strcat(szDialog2, "Job name\tLevel\tOwner\tDistance\n");

    for(new j = 1; j <= MAX_JOBS; j++) 
    {
        if(strlen(JobInfo[j][jName]) > 1) 
        {
            if(strcmp(JobInfo[j][jOwner], "None", true) == 0) 
            {
                Owner = "{BC1D1D}-{FFFFFF}";
            } else format(Owner, sizeof(Owner), "%s", JobInfo[j][jOwner]);

            gString[0] = EOS;
            format(gString, sizeof(gString), "%s\t%d\t%s\t%0.2fm\n", JobInfo[j][jName],JobInfo[j][jLevel], Owner, GetPlayerDistanceFromPoint(playerid, JobInfo[j][jPosX],JobInfo[j][jPosY],JobInfo[j][jPosZ]));
            strcat(szDialog2, gString);
            xx++;
        }
    }
    format(szTitle, sizeof(szTitle), "Jobs: %d", xx);
    ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Cancel");
    return true;
}

 

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.