OnDialogResponse Fehler

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Guten Tag,
    ich habe gerade bemerkt das er bei dem Befehl /confighouse die Dialoge nicht öffnet.
    Das gibt die Konsole aus:


    Hier der Code:
    [pwn=2082]
    if(dialogid == DIALOG_HOUSE_CONFIG)
    {
    if(response)
    {
    if(listitem == 0)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the Rent Price in the line below.\nCurrent Rent Price: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_rentprice]);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_RENTPRICE,DIALOG_STYLE_INPUT,"{FF7800}TRP - Rentprice",str,"Set","Back");
    return 1;
    }
    if(listitem == 1)
    {
    format(str,sizeof(str),"Rentable\nNot Rentable");
    ShowPlayerDialog(playerid,DIALOG_HOUSE_RENTABLE,DIALOG_STYLE_LIST,"{FF7800}TRP - Rentable",str,"Set","Back");
    return 1;
    }
    if(listitem == 2)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the amount that you want to deposit in your safe.\nCurrent Amount: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_money]);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_DEPOSIT,DIALOG_STYLE_INPUT,"{FF7800}TRP - Deposit",str,"Deposit","Back");
    return 1;
    }
    if(listitem == 3)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the amount that you want to deposit from your safe.\nCurrent Amount: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_money]);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_WITHDRAW,DIALOG_STYLE_INPUT,"{FF7800}TRP - Withdraw",str,"Withdraw","Back");
    return 1;
    }
    }
    }
    if(dialogid == DIALOG_HOUSE_RENTPRICE)
    {
    if(response)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the Rent Price in the line below.\nCurrent Rent Price: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_rentprice]);
    if(!IsNumeric(inputtext))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You have to enter a Number."),ShowPlayerDialog(playerid,DIALOG_HOUSE_RENTPRICE,DIALOG_STYLE_INPUT,"{FF7800}TRP - Rentprice",str,"Ok","Back");
    if(strval(inputtext) < 0 || strval(inputtext) > 2500)return SendClientMessage(playerid,Rot,"Error: {FFFFFF}The Minimal Amount is 0$ and the Maximum Amount is 2500$."),ShowPlayerDialog(playerid,DIALOG_HOUSE_RENTPRICE,DIALOG_STYLE_INPUT,"{FF7800}TRP - Rentprice",str,"Ok","Back");
    HouseInfo[houseowner][h_rentprice] = strval(inputtext);
    format(str,sizeof(str),"[SInfo] {FFFFFF}The Rent Price is now %i$",HouseInfo[houseowner][h_rentprice]);
    SendClientMessage(playerid,Gelb,str);
    Delete3DTextLabel(HouseInfo[houseowner][h_label]);
    format(str,sizeof(str),"This Villa is already bought.\nType /rent to rent a room in this Villa.\nOwner: %s\nRent Price: %i$",HouseInfo[houseowner][h_owner],HouseInfo[houseowner][h_rentprice]);
    HouseInfo[houseowner][h_label] = Create3DTextLabel(str,Weiß,HouseInfo[houseowner][h_enterX],HouseInfo[houseowner][h_enterY],HouseInfo[houseowner][h_enterZ],10.0,0,0);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    }
    if(dialogid == DIALOG_HOUSE_RENTABLE)
    {
    if(response)
    {
    format(str,sizeof(str),"Rentable\nNot Rentable");
    if(listitem == 0)
    {
    HouseInfo[houseowner][h_rentable] = 1;
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return SendClientMessage(playerid,Gelb,"[SInfo] {FFFFFF}Your house is now {FF7800}Rentable{FFFFFF}.");
    }
    else if(listitem == 1)
    {
    HouseInfo[houseowner][h_rentable] = 0;
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return SendClientMessage(playerid,Gelb,"[SInfo] {FFFFFF}Your house is no longer {FF7800}Rentable{FFFFFF}.");
    }
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    }
    if(dialogid == DIALOG_HOUSE_DEPOSIT)
    {
    if(response)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the amount that you want to deposit in your safe.\nCurrent Amount: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_money]);
    if(!IsNumeric(inputtext))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You have to enter a Number."),ShowPlayerDialog(playerid,DIALOG_HOUSE_DEPOSIT,DIALOG_STYLE_INPUT,"{FF7800}TRP - Deposit",str,"Deposit","Back");
    if(strval(inputtext) <= 0)return SendClientMessage(playerid,Rot,"Error: {FFFFFF}The amount can't be smaller then 0 or cant't be 0"),ShowPlayerDialog(playerid,DIALOG_HOUSE_DEPOSIT,DIALOG_STYLE_INPUT,"{FF7800}TRP - Deposit",str,"Deposit","Back");
    HouseInfo[houseowner][h_money] = HouseInfo[houseowner][h_money]+strval(inputtext);
    GivePlayerMoney(playerid,-strval(inputtext));
    format(str,sizeof(str),"[SInfo] {FFFFFF}Your current amount in your House Safe is now: %i$",HouseInfo[houseowner][h_money]);
    SendClientMessage(playerid,Gelb,str);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    }
    if(dialogid == DIALOG_HOUSE_WITHDRAW)
    {
    if(response)
    {
    format(str,sizeof(str),"{FFFFFF}Please enter the amount that you want to deposit from your safe.\nCurrent Amount: {FF7800}%i{FFFFFF}$",HouseInfo[houseowner][h_money]);
    if(!IsNumeric(inputtext))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You have to enter a Number."),ShowPlayerDialog(playerid,DIALOG_HOUSE_WITHDRAW,DIALOG_STYLE_INPUT,"{FF7800}TRP - Withdraw",str,"Withdraw","Back");
    if(strval(inputtext) <= 0)return SendClientMessage(playerid,Rot,"Error: {FFFFFF}The amount can't be smaller then 0 or can't be 0"),ShowPlayerDialog(playerid,DIALOG_HOUSE_WITHDRAW,DIALOG_STYLE_INPUT,"{FF7800}TRP - Withdraw",str,"Withdraw","Back");
    if(strval(inputtext) > HouseInfo[houseowner][h_money])return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You dont have enough money in your safe."),ShowPlayerDialog(playerid,DIALOG_HOUSE_WITHDRAW,DIALOG_STYLE_INPUT,"{FF7800}TRP - Withdraw",str,"Withdraw","Back");
    HouseInfo[houseowner][h_money] = HouseInfo[houseowner][h_money]-strval(inputtext);
    GivePlayerMoney(playerid,strval(inputtext));
    format(str,sizeof(str),"[SInfo] {FFFFFF}You have withdrawn %i$",strval(inputtext));
    SendClientMessage(playerid,Gelb,str);
    format(str,sizeof(str),"[SInfo] {FFFFFF}Your current amount in your House Safe is now: %i$",HouseInfo[houseowner][h_money]);
    SendClientMessage(playerid,Gelb,str);
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    }


    [/pwn]


    Danke im voraus


    //EDIT::
    Code bearbeitet.
    Info.
    Jeffry:



    new str[250];

    Einmal editiert, zuletzt von CaZe ()

  • Hm, dass kann eigentlich nicht hinhauen, da es ja bei dem Befehl ausgelesen wird. Und auch in der DB der Name der selbe wi InGame ist.
    /confighouse

    ocmd:confighouse(playerid,params[])
    {
    if(!IsPlayerOnline(playerid))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You are not logged in.");
    for(new h=0;h<MAX_HOUSES;h++)
    {
    if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[h][h_exitX],HouseInfo[h][h_exitY],HouseInfo[h][h_exitZ]))
    {
    if(!strcmp(HouseInfo[h][h_owner],getPlayerName(playerid),false))
    {
    ShowPlayerDialog(playerid,DIALOG_HOUSE_CONFIG,DIALOG_STYLE_LIST,"{FF7800}TRP - Confighouse","Change Rentprice\nRentAble\nDeposit Money\nWithdraw Money","Ok","Cancel");
    return 1;
    }
    }
    }
    return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You are not close to your House.");
    }

    Klappt doch Danke dir hatte vergessen zu compilen :S
    //EDIT::
    Und ne kleiner Frage: Wieso schreibe ich diese Zeile über mehrere Zeilen:

    mysql_format(Handle,query,sizeof(query),"UPDATE user SET Geld='%i',KontoMoney='%i',Level='%i',ALevel='%i',Skin='%i',Sex='%i',Fraktion='%i',OwnHouse='%i',HouseID='%i',Spawn='%i' WHERE BINARY username='%e'",GetPlayerMoney(playerid),SpielerInfo[playerid][pKonto],GetPlayerScore(playerid),SpielerInfo[playerid][pGender],SpielerInfo[playerid][pALevel],GetPlayerSkin(playerid),SpielerInfo[playerid][pFrak],SpielerInfo[playerid][pOwnHouse],SpielerInfo[playerid][pHouseID],SpielerInfo[playerid][pSpawn],getPlayerName(playerid));

    Denn er gibt mir diesen Error aus:

    Code
    C:\Users\Patrice\Desktop\Sa-Mp\gamemodes\ForFun.pwn(2740) : error 075: input line too long (after substitutions)

    2 Mal editiert, zuletzt von CaZe ()

  • Wie übergibst du denn das houseowner? Also wo setzt du dem einen Wert? Weil im Befehl speicherst du keinen Wert.


    Zwecks der anderen Frage:
    mysql_format(Handle,query,sizeof(query),"UPDATE user SET Geld='%i',KontoMoney='%i',Level='%i',ALevel='%i',Skin='%i',Sex='%i',Fraktion='%i',OwnHouse='%i',HouseID='%i',Spawn='%i' WHERE BINARY username='%e'",
    GetPlayerMoney(playerid),SpielerInfo[playerid][pKonto],GetPlayerScore(playerid),SpielerInfo[playerid][pGender],SpielerInfo[playerid][pALevel],GetPlayerSkin(playerid),SpielerInfo[playerid][pFrak],
    SpielerInfo[playerid][pOwnHouse],SpielerInfo[playerid][pHouseID],SpielerInfo[playerid][pSpawn],getPlayerName(playerid));
    So reicht es in diesem Fall schon.



    EDIT: (Post unten)
    CaZe: Dankeschön, das wünsche ich dir auch! :)

    3HZXdYd.png

    Einmal editiert, zuletzt von Jeffry ()