09.12.2017, 17:43
You must declare it as array, eg:
(The define holds the maximum length of the first name, optional but useful to check for input length etc).
Later, you can insert inputtext to the array like this:
It must be a multidimensional array, because you don't want to store just one value per player, but a string (array).
Код:
#define MAX_FIRSTNAME 20 new CharacterFirstname[MAX_PLAYERS][MAX_FIRSTNAME];
Later, you can insert inputtext to the array like this:
Код:
CharacterFirstname[playerid][0] = 0; // Empties the string, in case you didn't do it in OnPlayerConnect strcat(CharacterFirstname[playerid], inputtext, MAX_FIRSTNAME); // Writes inputtext into the array - strcat appends strings, so it must be cleared before (see above)