Example of your "solution":
pawn Код:
if(dialogid == TRANSFERBB)
{
if(response)
{
new target[MAX_PLAYER_NAME], cast[MAX_PLAYER_NAME], mystring[128], targetstring[128], targetfile[128], myfile[128];
if(!strlen(inputtext)) return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
if(strlen(inputtext))
{
new TargetID, Amount;
if(!sscanf(inputtext, "ui", TargetID, Amount))
{
GetPlayerName(playerid, cast, sizeof cast); GetPlayerName(TargetID, target, sizeof target);
format(targetfile, sizeof targetfile, Bankfile, target); format(myfile, sizeof myfile, Bankfile, cast);
if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, SKY_BLUE, " ** Invalid playerid! ") && TransferBB
if(TargetID == playerid) return SendClientMessage(playerid, SKY_BLUE, " ** You can't send money to your own bank account! ") && TransferBB
if(Amount > dini_Int(myfile, "Cash amount")) return SendClientMessage(playerid, SKY_BLUE, " ** You do not have that amount of money on your bank account! ") && TransferBB
if(Amount < dini_Int(myfile, "Cash amount"))
{
dini_IntSet(myfile, "Cash amount", dini_Int(myfile, "Cash amount") - Amount); dini_IntSet(targetfile, "Cash amount", dini_Int(targetfile, "Cash amount") + Amount);
format(mystring, sizeof mystring, " ** You transfered $%i to %s his bank account ", Amount, TargetID);
format(targetstring, sizeof targetstring, " ** %s transfered $%i to your bank account ", cast, Amount);
SendClientMessage(playerid, SKY_BLUE, mystring); SendClientMessage(TargetID, SKY_BLUE, targetstring);
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** Please fill in something ")&& TransferBB
}
}
else if(!response)
{
Bankhome
}
}
Example of the same code, but then with tabs:
pawn Код:
if(dialogid == TRANSFERBB)
{
if(response)
{
new target[MAX_PLAYER_NAME], cast[MAX_PLAYER_NAME], mystring[128], targetstring[128], targetfile[128], myfile[128];
if(!strlen(inputtext)) return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
if(strlen(inputtext))
{
new TargetID, Amount;
if(!sscanf(inputtext, "ui", TargetID, Amount))
{
GetPlayerName(playerid, cast, sizeof cast); GetPlayerName(TargetID, target, sizeof target);
format(targetfile, sizeof targetfile, Bankfile, target); format(myfile, sizeof myfile, Bankfile, cast);
if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, SKY_BLUE, " ** Invalid playerid! ") && TransferBB
if(TargetID == playerid) return SendClientMessage(playerid, SKY_BLUE, " ** You can't send money to your own bank account! ") && TransferBB
if(Amount > dini_Int(myfile, "Cash amount")) return SendClientMessage(playerid, SKY_BLUE, " ** You do not have that amount of money on your bank account! ") && TransferBB
if(Amount < dini_Int(myfile, "Cash amount"))
{
dini_IntSet(myfile, "Cash amount", dini_Int(myfile, "Cash amount") - Amount); dini_IntSet(targetfile, "Cash amount", dini_Int(targetfile, "Cash amount") + Amount);
format(mystring, sizeof mystring, " ** You transfered $%i to %s his bank account ", Amount, TargetID);
format(targetstring, sizeof targetstring, " ** %s transfered $%i to your bank account ", cast, Amount);
SendClientMessage(playerid, SKY_BLUE, mystring); SendClientMessage(TargetID, SKY_BLUE, targetstring);
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** Please fill in something ")&& TransferBB
}
}
else if(!response)
{
Bankhome
}
}
Last piece is way more organized