26.12.2017, 17:37
Quote:
What can happen if I use a function to return a string? I heard is is bad practice, but idk when, how and what could happen
|
I now consider readability and optimization both important together whenever possible but when it's not, I go for readability (matters though)...
So look in my COD script I've a array with rank names and their scores, I use a function called return
PHP Code:
GetRankName(rankid) {
new rankname[MAX_RANK_NAME_LEN];
format(rankname, sizeof rankname, gRanks[rankid][E_RANK_NAME]);
return rankname;
} // Written in the web browser, neglect the indentation
PHP Code:
gRanks[rankid][E_RANK_NAME]