Jump to content
  • 0

Am nevoie de putin ajutor :)


VAurel

Question

Salut, am vrut sa fac comanda /housemenu, pentru a putea seta descrierea casei si mai multe chestii, doar ca am intampinat o problema.

Eu am vrut sa fac prima oara intr-un dialog in care sa apara o lista de unde sa alegi ce vrei sa faci, ok am facut asta si functioneaza. Am facut dialogul de setarea descrierei casei, doar ca nu mi-se deschide dialog-ul unde trebuie sa scriu asta. Aveti o poza mai jos cu codul, multumesc pentru atentie ❤️ 

Eu nu imi dau seama de ce am facut gresit, daca este ceva care este gresit si este iesit in evidenta, v-as ruga sa imi atrageti atentia, pentru ca oricum eu lucrez numai la ore tarzii, si sa nu mai repet aceeasi greseala :) Multumes anticipat ❤️ 

 

Untitled.png

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

incearca sa adaptezi, nush daca e asta rezolvarea :))) 

Dialog:HOUSEMENU(playerid, listitem, response, inputtext[]) {
    if(!response) return 1;
    switch(listitem) {
        case 0: {
            Dialog_Show(playerid, HOUSEMENU2, DIALOG_STYLE_INPUT, "Input House Description", "insert here", "choose", "cancel");
        }
        case 1: sendError(playerid, "Momentan. sisemul de rent house este in lucru!");
    }
    return 1;
}
Dialog:HOUSEMENU2(playerid, listitem, response, inputtext[]) {
    if(!response) return 1;
    new maxc = strlen(inputtext);
    if(maxc > 30) return sendError(playerid, "Too many characters ( 0-30 ).");
    format(VariabilaCasei[house][VariabilaDescriereCasa], 256, inputtext);
    SCMf(playerid, COLOR_WHITE, "Descrierea casei tale este acum: %s", inputtext);
    mysql_format(SQL,gQuery,sizeof(gQuery),"UPDATE `houses` SET `Description`='%s' WHERE ID = '%d'",VariabilaCasei[house][VariabilaDescriereCasa],PlayerInfo[playerid][pHouseKey]);
    mysql_tquery(SQL,gQuery,"","");
    OnPropTextDrawUpdate(1, casa);
    return 1;
}

(PSSt: adaptezi tu)

Link to comment
Share on other sites

  • 0

mysql_format(SQL,gQuery,sizeof(gQuery),"UPDATE `houses` SET `Description`='%s' WHERE ID = '%d'",VariabilaCasei[house][VariabilaDescriereCasa],PlayerInfo[playerid][pHouseKey]); /// Aici in loc de "VariabilaCasei[house][VariabilaDescriereCasa]" Nu trebuia "inputtext" ? :)) Intreb doar, da-mi discordul tau si vorbim acolo :) 

Link to comment
Share on other sites

  • 0
5 hours ago, VAurel said:

mysql_format(SQL,gQuery,sizeof(gQuery),"UPDATE `houses` SET `Description`='%s' WHERE ID = '%d'",VariabilaCasei[house][VariabilaDescriereCasa],PlayerInfo[playerid][pHouseKey]); /// Aici in loc de "VariabilaCasei[house][VariabilaDescriereCasa]" Nu trebuia "inputtext" ? :)) Intreb doar, da-mi discordul tau si vorbim acolo :) 

nu pentru ca tu   ai format VariabilaCasei[house][VariabilaDescriereCasa]

   format(VariabilaCasei[house][VariabilaDescriereCasa], 256, inputtext);

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 0
Dialog:HOUSEMENU(playerid, listitem, response, inputtext[]) {
	if(!response) return 1;
	if(listitem == 0) Dialog_Show(playerid, HOUSEMENU2, DIALOG_STYLE_INPUT, "Input House Description", "Insert Here", "Choose", "Cancel");
	else if(listitem == 1) return sendError(playerid, "Momentan sistemul de Rent House este in lucru!");
	return 1;
}

Dialog:HOUSEMENU2(playerid, listitem, response, inputtext[]) {
    if(!response) return 1;
    if(strlen(inputtext) > 30 || strlen(inputtext) < 1) return sendError(playerid, "Too many characters (1-30).");

    SCMf(playerid, COLOR_WHITE, "Descrierea casei tale este acum: %s", inputtext);
    // aici formatezi descrierea casei
    // ex: format(houseVariables[h][hDescription], 64, description);

    mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `houses` SET `Description` = '%s' WHERE ID = '%d'", inputtext, pData[playerid][pHouseKey]);
    mysql_tquery(SQL, gQuery, "", "");
    OnPropTextDrawUpdate(1, casa);
    return 1;
}

Incearca asta.

  • Thanks 1
Link to comment
Share on other sites

  • 0
12 hours ago, IrinelBro57 said:
Dialog:HOUSEMENU(playerid, listitem, response, inputtext[]) {
	if(!response) return 1;
	if(listitem == 0) Dialog_Show(playerid, HOUSEMENU2, DIALOG_STYLE_INPUT, "Input House Description", "Insert Here", "Choose", "Cancel");
	else if(listitem == 1) return sendError(playerid, "Momentan sistemul de Rent House este in lucru!");
	return 1;
}

Dialog:HOUSEMENU2(playerid, listitem, response, inputtext[]) {
    if(!response) return 1;
    if(strlen(inputtext) > 30 || strlen(inputtext) < 1) return sendError(playerid, "Too many characters (1-30).");

    SCMf(playerid, COLOR_WHITE, "Descrierea casei tale este acum: %s", inputtext);
    // aici formatezi descrierea casei
    // ex: format(houseVariables[h][hDescription], 64, description);

    mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `houses` SET `Description` = '%s' WHERE ID = '%d'", inputtext, pData[playerid][pHouseKey]);
    mysql_tquery(SQL, gQuery, "", "");
    OnPropTextDrawUpdate(1, casa);
    return 1;
}

Incearca asta.

Salut, am incercat si metoda ta. Scuze ca am raspuns asa greu, dar... Aparent nu functioneaza, mai pe scurt nu se deschide dialog-ul in care trebuie pusa descrierea  :) Adica, asta nu functioneaza.

Link to comment
Share on other sites

  • 0
26 minutes ago, Flint said:

Dialog:HOUSEMENU2(playerid, response, listitem, inputtext[]) / verifica ce listitem se apeleaza.

Mersi pentru ajutor, dar nu mai conteaza acum, am renuntat la ideea de dialog :) Am facut direct pe comanda :)) Mersi oricum ❤️ 

Link to comment
Share on other sites

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.