Inputtext closing dialog box? -
Antonio [G-RP] - 01.06.2010
For some reason, whenever I enter a number, the dialog box shuts. Help please?
pawn Код:
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot deposit more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - strval(inputtext);
AntiHack(playerid, -strval(inputtext));
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + strval(inputtext);
}
Re: Inputtext closing dialog box? -
Conroy - 01.06.2010
pawn Код:
if(dialogid==6) {
if(response) {
if(strval(inputtext) > PlayerInfo[playerid][pCash]) SendClientMessage(playerid, COLOR_RED, "You cannot deposit more money that you atcually have!");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - strval(inputtext);
AntiHack(playerid, -strval(inputtext));
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + strval(inputtext);
SendClientMessage(playerid, COLOR_GREEN, "Success!");
}
}
Re: Inputtext closing dialog box? -
Conroy - 01.06.2010
If you don't get a message, check your Dialog ID's
EDIT: Sorry for double post, meant to edit first one.
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 01.06.2010
Still didn't work, for some reason it just randomly closes when I enter the first number
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 01.06.2010
Yo boii's wouldnt mind some help
Re: Inputtext closing dialog box? -
[NYRP]Mike. - 01.06.2010
pawn Код:
#define DBANKQ 2064
#define DBANKW 2065
#define DBANKD 2066
pawn Код:
if (dialogid == DBANKQ)
{
if (response == 1) // Withdraw
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
}
else // Deposit
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
}
}
if (dialogid == DBANKD) // BANK / DEPOSIT
{
if (response == 1) // OK
{
if(IsNull(inputtext))
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
if (strval(inputtext) > GetPlayerMoney(playerid) || strval(inputtext) < 1)
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
SafeGivePlayerMoney(playerid, (0 - strval(inputtext)));
PlayerInfo[playerid][pCash] -= strval(inputtext);
PlayerInfo[playerid][pAccount]=strval(inputtext)+PlayerInfo[playerid][pAccount];
}
else // CANCEL
{
}
return 1;
}
if (dialogid == DBANKW) // WITHDRAW
{
if (response == 1) // OK
{
if(IsNull(inputtext))
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
if (strval(inputtext) > PlayerInfo[playerid][pAccount] || strval(inputtext) < 1)
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
SafeGivePlayerMoney(playerid,strval(inputtext));
PlayerInfo[playerid][pCash] += strval(inputtext);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-strval(inputtext);
}
else // CANCEL
{
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 50, -2158.8682,643.0779,1052.3750))
{
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to withdraw from your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKW,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 50, -2158.8682,643.0779,1052.3750))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
format(string, sizeof(string), "You have $%d in your account, and $%d in your wallet.\n\nHow much do you want to deposit into your bank account:", PlayerInfo[playerid][pAccount],GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,DBANKD,DIALOG_STYLE_INPUT,"Q:RP - Bank Question",string,"Ok","Cancel");
return 1;
}
return 1;
}
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 01.06.2010
Wow, thanks
Re: Inputtext closing dialog box? -
[NYRP]Mike. - 01.06.2010
Anytime.
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 01.06.2010
Its gotta be me.. it STILL closes after I enter the first number!
Re: Inputtext closing dialog box? -
[NYRP]Mike. - 02.06.2010
Did you press "Deposit" or "Withdraw" or just pressed ENTER?
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
I pressed Deposit, but when I enter any number into the inputtext slot thingy, it just closes and puts it in my bank.
Re: Inputtext closing dialog box? -
[NYRP]Mike. - 02.06.2010
Isn't that the aim?
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
First number it auto-closes, It doesn't let me get past 1 number in the box
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
I'd like to add that its only on numbers, not letters.
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
Bump
Re: Inputtext closing dialog box? -
Conroy - 02.06.2010
It closes without you pressing any buttons?
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
Yes, I simply enter a number and it closes.
Re: Inputtext closing dialog box? -
aircombat - 02.06.2010
Код:
ShowPlayerDialog(playerid,123321,DIALOG_STYLE_INPUT,"Deposit","Please Enter The Number You Want To Desposit","Done","Cancel");
Код:
if(dialogid == 123321)
{
if(!response) return 1;
if(response)
{
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot deposit more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - strval(inputtext);
AntiHack(playerid, -strval(inputtext));
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + strval(inputtext);
}
}
Re: Inputtext closing dialog box? -
Antonio [G-RP] - 02.06.2010
I noticed that your dialog id is 123321, why is it so high?
And, are you sure this works?
Re: Inputtext closing dialog box? -
aircombat - 03.06.2010
1.u can use any number for dialog even if 999999999999999999999999 i just make it high so i make sure it doesn't conflict with another dialog
2.i am sure it will work cause that's the way i made my EBank system in my signature