#1

Loose intend, i tried evry possible thing, still its appearing somewhere in here
if(dialogid == BANK_MENU_2)
{
if(response)
{
new username[24];
if(sscanf(inputtext, "s[24]", username))
{
ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel");
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid USERNAME");
return 1;
}
if(strcmp(GetName(playerid), username, true) == 0)
{
ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel");
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You cannot transfer funds to your own account!");
return 1;
}
format(Bank_Transfer_To[playerid], 24, "%s", username);
mysql_format(MySQL, gQuery, 256, "SELECT * FROM `"Banks_Table"` WHERE `Holder` = '%e'", username);
mysql_tquery(MySQL, gQuery, "Safe_IsBankHolder", "i", playerid);
/*format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", username);
ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
*/}
}
//error line if(dialogid == BANK_MENU_2_1)
{
if(response)
{
new money, str[256];
if((sscanf(inputtext, "i", money)))
{
format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]);
ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid amount!");
return 1;
}
if(Bank_Balance[playerid] < money)
{
format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]);
ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You don't have enough money!");
return 1;
}
if(IsPlayerConnected(GetPlayerID(Bank_Transfer_To[playerid])))
{
format(Bank_Transfer_From[(GetPlayerID(Bank_Transfer_To[playerid]))], 24, "%s", GetName(playerid));
format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"Your bank account has been credited with "RED"$%i "PREMIUM"by "RED"%s", money, GetName(playerid));
SendClientMessage(GetPlayerID(Bank_Transfer_To[playerid]), -1, str);
Bank_Balance[GetPlayerID(Bank_Transfer_To[playerid])] += money;
}
else
{
mysql_format(MySQL, str, sizeof str, "UPDATE "Banks_Table" SET Balance = Balance + '%i' WHERE Holder = '%e'", money, Bank_Transfer_To[playerid]);
mysql_tquery(MySQL, str, "", "");
}
format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"You have successfully transferred "RED"$%i "PREMIUM"to "RED"%s"PREMIUM".", money, Bank_Transfer_To[playerid]);
SendClientMessage(playerid, -1, str);
Bank_Balance[playerid] -= money;
format(IQuery, 256, "4[Bank of SFS] 1 - 14%s(%i) transferred 4$%i 14to %s!", GetName(playerid), playerid, money, Bank_Transfer_To[playerid]);
IRC_GroupSay(gGroupAdminID, IRC_Admin, IQuery);
}
}
Reply
#2

Use format [CODE] on forum, it makes the code to see the tabs.
Reply
#3

Your code is all set to one line, here try this:
PHP код:
        Loose intendi tried evry possible thingstill its appearing somewhere in here
        
if(dialogid == BANK_MENU_2)
        {
        if(
response)
        {
        new 
username[24];
        if(
sscanf(inputtext"s[24]"username))
        {
        
ShowPlayerDialog(playeridBANK_MENU_2DIALOG_STYLE_INPUT""RED"Bank - Transfer Funds"""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:""Proceed""Cancel");
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"Please enter a valid USERNAME");
        return 
1;
        }
        if(
strcmp(GetName(playerid), usernametrue) == 0)
        {
        
ShowPlayerDialog(playeridBANK_MENU_2DIALOG_STYLE_INPUT""RED"Bank - Transfer Funds"""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:""Proceed""Cancel");
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"You cannot transfer funds to your own account!");
        return 
1;
        }
        
format(Bank_Transfer_To[playerid], 24"%s"username);
        
mysql_format(MySQLgQuery256"SELECT * FROM `"Banks_Table"` WHERE `Holder` = '%e'"username);
        
mysql_tquery(MySQLgQuery"Safe_IsBankHolder""i"playerid);
        
/*format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", username);
        ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
        */
}
        }
        
//error line if(dialogid == BANK_MENU_2_1)
        
{
        if(
response)
        {
        new 
moneystr[256];
        if((
sscanf(inputtext"i"money)))
            {
        
format(strsizeof str""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:"Bank_Transfer_To[playerid]);
        
ShowPlayerDialog(playeridBANK_MENU_2_1DIALOG_STYLE_INPUT""RED"Bank - Transfer Funds"str"Transfer""Cancel");
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"Please enter a valid amount!");
        return 
1;
        }
        if(
Bank_Balance[playerid] < money)
        {
        
format(strsizeof str""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:"Bank_Transfer_To[playerid]);
        
ShowPlayerDialog(playeridBANK_MENU_2_1DIALOG_STYLE_INPUT""RED"Bank - Transfer Funds"str"Transfer""Cancel");
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"You don't have enough money!");
        return 
1;
        }
        if(
IsPlayerConnected(GetPlayerID(Bank_Transfer_To[playerid])))
        {
        
format(Bank_Transfer_From[(GetPlayerID(Bank_Transfer_To[playerid]))], 24"%s"GetName(playerid));
        
format(strsizeof str""RED"Bank of SFS "WHITE"- "PREMIUM"Your bank account has been credited with "RED"$%i "PREMIUM"by "RED"%s"moneyGetName(playerid));
        
SendClientMessage(GetPlayerID(Bank_Transfer_To[playerid]), -1str);
        
Bank_Balance[GetPlayerID(Bank_Transfer_To[playerid])] += money;
        }
        else
        {
        
mysql_format(MySQLstrsizeof str"UPDATE "Banks_Table" SET Balance = Balance + '%i' WHERE Holder = '%e'"moneyBank_Transfer_To[playerid]);
        
mysql_tquery(MySQLstr"""");
        }
        
format(strsizeof str""RED"Bank of SFS "WHITE"- "PREMIUM"You have successfully transferred "RED"$%i "PREMIUM"to "RED"%s"PREMIUM"."moneyBank_Transfer_To[playerid]);
        
SendClientMessage(playerid, -1str);
        
Bank_Balance[playerid] -= money;
        
format(IQuery256"4[Bank of SFS] 1 - 14%s(%i) transferred 4$%i 14to %s!"GetName(playerid), playeridmoneyBank_Transfer_To[playerid]);
        
IRC_GroupSay(gGroupAdminIDIRC_AdminIQuery);
        }
        }
        
fireranger11 is online now  Add to fireranger11's Reputation  Report Post 
Reply
#4

Quote:
Originally Posted by Antenastyle
Посмотреть сообщение
Use format [CODE] on forum, use this in the top of your script:

Код:
#pragma tabsize 0
Don't ever use this. It encourages bad practice. Any competent programmer can indent their code. Use TAB, or if you're really that bad, use spacebar (4 times, i believe).

@OP Use something like this if you're really struggling. Don't follow the above post.

Quote:

Banned Code - There is a certain "#pragma" that can be used to hide significant warnings and produce unreadable code - DO NOT advocate its use if you know what it is; it is TERRIBLE practice and we want to get rid of it.

source
Reply
#5

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Don't ever use this. It encourages bad practice. Any competent programmer can indent their code. Use TAB, or if you're really that bad, use spacebar (4 times, i believe).

@OP Use something like this if you're really struggling. Don't follow the above post.


source
Yeah, I know that's bad, I don't, and won't use it...
Reply
#6

Now the intend is here
if(dialogid == BANK_MENU_2)
Reply
#7

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Don't ever use this. It encourages bad practice. Any competent programmer can indent their code. Use TAB, or if you're really that bad, use spacebar (4 times, i believe).

@OP Use something like this if you're really struggling. Don't follow the above post.


source
https://www.youtube.com/watch?v=SsoOG6ZeyUI

Just had to since you mentioned it :P
Reply
#8

Try this

Код:
if(dialogid == BANK_MENU_2)
{
	if(response)
	{
		new username[24];
		if(sscanf(inputtext, "s[24]", username))
		{
			ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel");
			SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid USERNAME");
			return 1;
		}
		if(strcmp(GetName(playerid), username, true) == 0)
		{
			ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel");
			SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You cannot transfer funds to your own account!");
			return 1;
		}
		format(Bank_Transfer_To[playerid], 24, "%s", username);
		mysql_format(MySQL, gQuery, 256, "SELECT * FROM `"Banks_Table"` WHERE `Holder` = '%e'", username);
		mysql_tquery(MySQL, gQuery, "Safe_IsBankHolder", "i", playerid);
		/*format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", username);
		ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");*/
	}
}
if(dialogid == BANK_MENU_2_1)
{
	if(response)
	{
		new money, str[256];
		if((sscanf(inputtext, "i", money)))
		{
			format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]);
			ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
			SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid amount!");
			return 1;
		}
		if(Bank_Balance[playerid] < money)
		{
			format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]);
			ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");
			SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You don't have enough money!");
			return 1;
		}
		if(IsPlayerConnected(GetPlayerID(Bank_Transfer_To[playerid])))
		{
			format(Bank_Transfer_From[(GetPlayerID(Bank_Transfer_To[playerid]))], 24, "%s", GetName(playerid));
			format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"Your bank account has been credited with "RED"$%i "PREMIUM"by "RED"%s", money, GetName(playerid));
			SendClientMessage(GetPlayerID(Bank_Transfer_To[playerid]), -1, str);
			Bank_Balance[GetPlayerID(Bank_Transfer_To[playerid])] += money;
		}
		else
		{
			mysql_format(MySQL, str, sizeof str, "UPDATE "Banks_Table" SET Balance = Balance + '%i' WHERE Holder = '%e'", money, Bank_Transfer_To[playerid]);
			mysql_tquery(MySQL, str, "", "");
		}
		format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"You have successfully transferred "RED"$%i "PREMIUM"to "RED"%s"PREMIUM".", money, Bank_Transfer_To[playerid]);
		SendClientMessage(playerid, -1, str);
		Bank_Balance[playerid] -= money;
		format(IQuery, 256, "4[Bank of SFS] 1 - 14%s(%i) transferred 4$%i 14to %s!", GetName(playerid), playerid, money, Bank_Transfer_To[playerid]);
		IRC_GroupSay(gGroupAdminID, IRC_Admin, IQuery);
	}
}
Reply
#9

Thats not working as well
Reply
#10

Quote:
Originally Posted by fireranger11
Посмотреть сообщение
Thats not working as well
Error and line?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)