27.12.2016, 14:27
So, when it comes to script optimization( specially to the smart use of strings length) you would find me create a string new str[250] just to display a message like Welcome Back!
So I started focussing on change the way I work into a cleaner one, well, while I was working on something a couple of hours ago, it occurred to me something that can use as much low string size to store player's name, something much smaller than MAX_PLAYER_NAME, and then I wondered, what if I used this
I don't know if this would work or not, so I wanted to ask you guys, what do you thing?
So I started focussing on change the way I work into a cleaner one, well, while I was working on something a couple of hours ago, it occurred to me something that can use as much low string size to store player's name, something much smaller than MAX_PLAYER_NAME, and then I wondered, what if I used this
PHP Code:
#define P_NAME strlen(GetName(%0))
GetName(playerid){
new name_str[MAX_PLAYER_NAME];
GetPlayerName(playerid, name_str, sizeof(name_str));
return name_str;
}