if(dialogid == DIALOG_WITHDRAW)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Choose your value", "Please input a number in which you want to withdraw.\nPlease input a value!", "Ok", "Cancel");
}
new string[128];
if(PlayerInfo[playerid][Pbank] < strlen(inputtext))
{
SendClientMessage(playerid, COLOR_RED, "Sorry, you dont have this much cash");
return 1;
}
else if(strlen(inputtext) < 0 || strlen(inputtext) > 1000000)
{
SendClientMessage(playerid, COLOR_RED, "Only number values and it has to be more than 0 and less than 1 million");
return 1;
}
else if(PlayerInfo[playerid][Pbank] >=strlen(inputtext))
{
GivePlayerMoney(playerid, strlen(inputtext));
PlayerInfo[playerid][Pbank] -=strlen(inputtext);
format(string, sizeof(string), "Thank you for using san fierro bank.\nYou have withdrawn $%i from your bank account.\nYour bank balence now stands at $%i", strlen(inputtext), PlayerInfo[playerid][Pbank]);
ShowPlayerDialog(playerid, 1939, DIALOG_STYLE_MSGBOX, "Withdraw statment", string, "Ok", "Close");
return 1;
}
}
Only number values and it has to be more than 0 and less than 1 million |
if(!strval(inputtext))
This forum requires that you wait 120 seconds between posts. Please try again in 39 seconds.
0 a b c d e f g h i j k l m n o p q r s t u v w x y z
if(dialogid == DIALOG_WITHDRAW)
{
if(!strval(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Choose your value", "Please input a number in which you want to withdraw.\nPlease input a value!", "Ok", "Cancel");
}
else
{
new string[128];
if(PlayerInfo[playerid][Pbank] < strval(inputtext))
{
SendClientMessage(playerid, COLOR_RED, "Sorry, you dont have this much cash");
return 1;
}
if(strval(inputtext) < 0 || strval(inputtext) > 1000000)
{
SendClientMessage(playerid, COLOR_RED, "Only number values and it has to be more than 0 and less than 1 million");
return 1;
}
if(PlayerInfo[playerid][Pbank] >=strval(inputtext))
{
GivePlayerMoney(playerid, strval(inputtext));
PlayerInfo[playerid][Pbank] -=strval(inputtext);
format(string, sizeof(string), "Thank you for using san fierro bank.\nYou have withdrawn $%i from your bank account.\nYour bank balence now stands at $%i", strval(inputtext), PlayerInfo[playerid][Pbank]);
ShowPlayerDialog(playerid, 1939, DIALOG_STYLE_MSGBOX, "Withdraw statment", string, "Ok", "Close");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You don't have that much money in bank!");
return 1;
}
}
if( !strlen( inputtext ) ) return print( "atleast write something" ); // if inputtext has nothing
if(dialogid == DIALOG_WITHDRAW)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Choose your value", "Please input a number in which you want to withdraw.\nPlease input a value!", "Ok", "Cancel");
}
new string[128];
if(PlayerInfo[playerid][Pbank] < strval(inputtext))
{
SendClientMessage(playerid, COLOR_RED, "Sorry, you dont have this much cash");
return 1;
}
else if(strval(inputtext) < 0 || strval(inputtext) > 1000000)
{
SendClientMessage(playerid, COLOR_RED, "Only number values and it has to be more than 0 and less than 1 million");
return 1;
}
else if(PlayerInfo[playerid][Pbank] >=strval(inputtext))
{
new Query[200];
GivePlayerMoney(playerid, strval(inputtext));
PlayerInfo[playerid][Pbank] -=strval(inputtext);
format(Query, sizeof(Query), "UPDATE users SET bank =%i WHERE username='%s'", PlayerInfo[playerid][Pbank], PlayerName(playerid));
mysql_query(Query);
format(string, sizeof(string), "Thank you for using san fierro bank.\nYou have withdrawn $%i from your bank account.\nYour bank balence now stands at $%i", strval(inputtext), PlayerInfo[playerid][Pbank]);
ShowPlayerDialog(playerid, 1939, DIALOG_STYLE_MSGBOX, "Withdraw statment", string, "Ok", "Close");
return 1;
}
}
Ok then here is my dialog
pawn Код:
|