Guten Tag,
ich habe gerade bemerkt das er bei dem Befehl /confighouse die Dialoge nicht öffnet.
Das gibt die Konsole aus:
[17:38:47] [debug] Run time error 4: "Array index out of bounds"
[17:38:47] [debug] Accessing element at negative index -1
[17:38:47] [debug] AMX backtrace:
[17:38:47] [debug] #0 0001f080 in public OnDialogResponse (playerid=0, dialogid=9, response=1, listitem=0, inputtext[]=@000d1390 "Change Rentprice") at C:\Users\Patrice\Desktop\Sa-Mp\gamemodes\ForFun.pwn:2088
[17:38:49] [debug] Run time error 4: "Array index out of bounds"
[17:38:49] [debug] Accessing element at negative index -1
[17:38:49] [debug] AMX backtrace:
[17:38:49] [debug] #0 0001f080 in public OnDialogResponse (playerid=0, dialogid=9, response=1, listitem=0, inputtext[]=@000d1390 "Change Rentprice") at C:\Users\Patrice\Desktop\Sa-Mp\gamemodes\ForFun.pwn:2088
[17:38:53] [debug] Run time error 4: "Array index out of bounds"
[17:38:53] [debug] Accessing element at negative index -1
[17:38:53] [debug] AMX backtrace:
[17:38:53] [debug] #0 0001f29c in public OnDialogResponse (playerid=0, dialogid=9, response=1, listitem=2, inputtext[]=@000d1390 "Deposit Money") at C:\Users\Patrice\Desktop\Sa-Mp\gamemodes\ForFun.pwn:2100
[17:38:55] [debug] Run time error 4: "Array index out of bounds"
[17:38:55] [debug] Accessing element at negative index -1
[17:38:55] [debug] AMX backtrace:
[17:38:55] [debug] #0 0001f3d0 in public OnDialogResponse (playerid=0, dialogid=9, response=1, listitem=3, inputtext[]=@000d1390 "Withdraw Money") at C:\Users\Patrice\Desktop\Sa-Mp\gamemodes\ForFun.pwn:2106
Alles anzeigen
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];