Would this work?
#1

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
PHP Code:
#define P_NAME strlen(GetName(%0))
GetName(playerid){
    new 
name_str[MAX_PLAYER_NAME];
    
GetPlayerName(playeridname_strsizeof(name_str));
    return 
name_str;

I don't know if this would work or not, so I wanted to ask you guys, what do you thing?
Reply


Messages In This Thread
Would this work? - by Eoussama - 27.12.2016, 14:27
Re: Would this work? - by Spmn - 27.12.2016, 14:33
Re: Would this work? - by Eoussama - 27.12.2016, 14:40
Re: Would this work? - by SickAttack - 27.12.2016, 15:38
Re: Would this work? - by SyS - 27.12.2016, 15:41
Re: Would this work? - by Misiur - 28.12.2016, 15:49
Re: Would this work? - by CodeStyle175 - 28.12.2016, 17:31
Re: Would this work? - by SickAttack - 28.12.2016, 17:56
Re: Would this work? - by CodeStyle175 - 28.12.2016, 20:35
Re: Would this work? - by BiosMarcel - 28.12.2016, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)