Using SA-MP server's internal arrays

Was looking for opinions regarding usage of SA-MP's internal arrays which appear in SA-MP callbacks.

For example,
public OnPlayerCommandText(playerid, cmdtext[])
     strins(cmdtext, "cmd_", 1, 144);
     return 1;
The above code assumes that cmdtext array is large enough to hold the data which I believe is a reasonable assumption. Of course, Kalcor wouldn't be using dynamically allocated arrays since it would impact the performance so cmdtext should be a static array with the size of the longest client message that can be sent (haven't disassembled yet, not confirmed).

Just wanted to have your opinion on it since I could be overlooking potential problems. I have already run into problems when you call OnPlayerCommandText manually with a small array, for example, "OnPlayerCommandText(0, "/test");".

Forum Jump:

Users browsing this thread: