Jump to content
  • 0

Problema.


Shad0wdpbgd

Question

Salut, am o problema la acest sistem de quest-uri zilnice.

Nu am erori, dar cand intru pe joc si scriu /myquest imi arata asa: Daily quest: (progres: 0/0). Tin sa precizez ca nu la toate, doar la un quest (1 din 5) si chiar nu stiu ce are, daca poate sa ma ajute cineva, multumesc.

COD: 

stock questName(id) {
    new szName[128];
    switch(id) {
        case 1: szName = "Mergi pe muntele Chilliad.";
        case 2: szName = "Vinde 2 pesti.";
        case 3: szName = "Mergi pe stadionul de baseball din Las Venturas.";
        case 4: szName = "Livreaza 3 cutii cu pizza.";
        case 5: szName = "Mergi la piramida din orasul Las Venturas.";
    }
    return szName;
}

function checkQuest(playerid) {
    new result, quest = PlayerInfo[playerid][pQuest];
    if(quest == 1 || quest == 3 || quest == 5) result = 1;
    else if(quest == 2) result = 2;
    else if(quest == 4) result = 3;
    if(PlayerInfo[playerid][pQuestProgress] >= result) return 1;
    PlayerInfo[playerid][pQuestProgress] ++;
    Update(playerid, pQuestProgressx);
    new string[128];
    if(PlayerInfo[playerid][pQuestProgress] == result) {
        new money = 10000*PlayerInfo[playerid][pLevel] + random(5000);
        format(string, sizeof(string), "Misiunea [%s] a fost terminata!", questName(PlayerInfo[playerid][pQuest]));
        SCM(playerid, COLOR_YELLOW, string);
        format(string, sizeof(string), "Ai primit $%s si un respect point!", FormatNumber(money));
        SCM(playerid, COLOR_YELLOW, string);
        GivePlayerCash(playerid, money);
        PlayerInfo[playerid][pExp] ++;
        Update(playerid, pRP);
        UpdateProgressBar(playerid);
    }
    else {
        format(string, sizeof(string), "Progress pentru misiunea (%s), %d/%d.", questName(PlayerInfo[playerid][pQuest]), PlayerInfo[playerid][pQuestProgress], result);
        SCM(playerid, COLOR_YELLOW, string);
    }
    return 1;
}

function GiveQuest(playerid) {
    PlayerInfo[playerid][pQuest] = random(5);
    Update(playerid, pQuestx);
    PlayerInfo[playerid][pQuestProgress] = 0;
    Update(playerid, pQuestProgressx);
    SCM(playerid, COLOR_YELLOW, "Pentru a vedea ce misiune ai primit astazi, foloseste comanda /myquest.");
    return 1;
}

CMD:myquest(playerid, params[]) {
    new string[128], result, quest = PlayerInfo[playerid][pQuest];
    if(quest == 1 || quest == 3 || quest == 5) result = 1;
    else if(quest == 2) result = 2;
    else if(quest == 4) result = 3;

    format(string, sizeof(string), "Daily Quest: %s (progres: %d/%d)", questName(PlayerInfo[playerid][pQuest]), PlayerInfo[playerid][pQuestProgress], result);
    SCM(playerid, COLOR_YELLOW, string);
    return 1;
}

// problema cred ca este la checkquest, si tin sa precizez ca in baza de date am pus acolo as defined -1

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.