Jump to content

Recommended Posts

Posted

Salut sa-mp.ro am si eu o problema cand dau /buycrates pe telefon si dau da imi da crate fara sa se selecteze.

Eu vreau sa fac pe telefon sa se selecteze prima caseta GPoints prima

daca doriti discordul meu:AlbertDev#1810

doar sa se selecteze prima caseta pe telefon cand dai /buycrates

Salutari!

Posted (edited)

in dialog adauga

if(!response) return true;

daca am inteles gresit sau n-a mers, arata-ne comanda /buycrates (inclusiv dialogul)

Edited by Flint
Posted

@Flint comanda: }
YCMD:buycrate(playerid, params[], help) {
    new x;
    if(PlayerToPoint(3, playerid, 417.6335,-2570.5161,13.8522)) x = 0; 
    else if(PlayerToPoint(3, playerid, 409.9367,-2564.2122,13.8522)) x = 1;
    else if(PlayerToPoint(3, playerid, 402.3880,-2564.2168,13.8522)) x = 2; 
    else if(PlayerToPoint(3, playerid, 402.9582,-2576.2825,13.8522)) x = 3;
    else if(PlayerToPoint(3, playerid, 400.0225,-2570.4521,13.8522)) x = 4;
    else return SCM(playerid, COLOR_ERROR, "Nu esti in zona crate-urilor.");
    AlegeCrates[playerid] = x;
    gString[0] = EOS;
    format(gString, sizeof(gString), "{A0C4D3}Doresti sa cumperi un %s Crate?\nAcest crate costa {1A79A2}(%d GPoints / %d Premium Points){A0C4D3}.", CrateName[x], CratePrice[x][0], CratePrice[x][1]);
    ShowPlayerDialogEx(playerid, DIALOG_BUYCRATES, DIALOG_STYLE_MSGBOX, "Buy Crate", gString, "Da", "Nu");
    return true;
}

 

 

DIALOGUL:

 

 

}
            }
        }
        case DIALOG_BUYCRATES: {
            if(!response) 
                return true;

            format(gString, sizeof(gString), "Payment\tPrice\nGPoints\t{E26AF2}%d\nPremium Points\t{EEEE3F}%d", CratePrice[AlegeCrates[playerid]][0], CratePrice[AlegeCrates[playerid]][1]);
            ShowPlayerDialogEx(playerid, DIALOG_BUYCRATES1, DIALOG_STYLE_TABLIST_HEADERS, "Buy Crate", gString, "Da", "Nu");
        }
        case DIALOG_BUYCRATES1: {
            if(!response) return true;
            new x = AlegeCrates[playerid];
            switch(listitem) {
                case 0: {
                    if(PlayerInfo[playerid][pCPoints] < CratePrice[x][0]) return SCMf(playerid, -1, "Nu ai suficiente GPoints");
                    PlayerInfo[playerid][pCPoints] -= CratePrice[x][0];
                    format(gString, sizeof(gString), "(Crate Systems) {FFFFFF} Ti-ai cumparat o cutie (%s) pentru {E26AF2}%d GPoints {FFFFFF} ! Total cutii rare: %d [%d total - general]", CrateName[x], CratePrice[x][0], PlayerInfo[playerid][pCrates][x]+1, totalcrates(playerid)+1);
                    Update(playerid, pCPointsx);
                }
                case 1: {
                    if(PlayerInfo[playerid][pPremiumPoints] < CratePrice[x][1]) return SCMf(playerid, -1, "Nu ai suficiente puncte premium.");
                    PlayerInfo[playerid][pPremiumPoints] -= CratePrice[x][1];
                    format(gString, sizeof(gString), "(Crate Systems) {FFFFFF} Ti-ai cumparat o cutie (%s) pentru {EEEE3F}%d PP {FFFFFF} ! Total cutii rare: %d [%d total - general]", CrateName[x], CratePrice[x][1], PlayerInfo[playerid][pCrates][x]+1, totalcrates(playerid)+1);        
                    Update(playerid, pPremiumPointsx);
                }
            }        
            SCM(playerid, -1, "Pentru a deschide o cutie, foloseste /opencrate.");
            PlayerInfo[playerid][pCrates][x] ++;
            save_crates(playerid);
        }

Posted

E posibil ca variabila "AlegeCrates[playerid]" sa nu se reseteze si atunci cand inchizi dialogul sa-ti dea create-ul setat variabilei, fa un debug prin care verifici ce valoarea i se seteaza variabilei atunci cand inchizi dialogul.

  • 1 month later...
Posted
On 9/10/2021 at 1:25 PM, Flint said:

E posibil ca variabila "AlegeCrates[playerid]" sa nu se reseteze si atunci cand inchizi dialogul sa-ti dea create-ul setat variabilei, fa un debug prin care verifici ce valoarea i se seteaza variabilei atunci cand inchizi dialogul.

PM dacă mai ai nevoie de ajutor.

Join the conversation

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

Guest
Reply to this topic...

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