Better way to optimize this?
#1

I am just wondering if there is a way to optimize this bit of code a little better:
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");
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.
Reply


Messages In This Thread
Better way to optimize this? - by sim_sima - 15.12.2013, 15:33
Re: Better way to optimize this? - by Misiur - 15.12.2013, 15:45
Re: Better way to optimize this? - by Sinner - 15.12.2013, 16:10
Re: Better way to optimize this? - by 2KY - 15.12.2013, 16:19
Re: Better way to optimize this? - by AndreT - 15.12.2013, 16:45
Re: Better way to optimize this? - by sim_sima - 15.12.2013, 19:20

Forum Jump:


Users browsing this thread: 1 Guest(s)