15.12.2013, 15:33
I am just wondering if there is a way to optimize this bit of code a little better:
I am thinking of the variables "msgstr" and "diastr". I am just wondering if it is neccesary to have 2 variables? The 2 formats need variables with different array sizes. Is there a way to use the same variable, and redefine the size after the first use?
Thanks a lot.
pawn Код:
new msgstr[80 + MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(msgstr, sizeof(msgstr), "-MSG- The username '%s' is already registered. Please log in with your Password",name);
SendClientMessage(playerid, COLOR_YELLOW, msgstr);
SendClientMessage(playerid, COLOR_GREY, "-MSG- Not your account? Then relog with another name");
new diastr[60 + MAX_PLAYER_NAME];
format(diastr, sizeof(diastr), "{FFFF00}Your username: {FFFFFF}%s\n\nEnter your Password to log in",name);
ShowPlayerDialog(playerid, MENU_LOGIN, DIALOG_STYLE_PASSWORD, "Hopes Hills RP Account", diastr, "Login", "Quit");
Thanks a lot.