09.04.2018, 18:06
Quote:
Hi, I have some problem.
Код:
enum example { myName[MAX_PLAYER_NAME] }; new myInfo[MAX_PLAYERS][example], testStr[MAX_PLAYER_NAME]; format(testStr, sizeof(testStr), "%s", IsPlayerConnected(playerid) ? (myInfo[playerid][myName]) : ("Player is not connected")); The error occurs because of the parameter "myInfo[playerid][myName]", if instead substitute, for example Код:
format(testStr, sizeof(testStr), "%s", IsPlayerConnected(playerid) ? ("My_Name") : ("Player is not connected")); |
just use conventional GetName
PHP код:
enum example {
myName[MAX_PLAYER_NAME]//not needed anymore
};
new myInfo[MAX_PLAYERS][example], testStr[MAX_PLAYER_NAME];
format(testStr, sizeof(testStr), "%s", IsPlayerConnected(playerid) ? getName(playerid) : "Player is not connected");
getName(playerid)
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, MAX_PLAYER_NAME);
return n;
}