error 033
#2

Quote:
Originally Posted by FelixAquero
Посмотреть сообщение
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"));
When compiling, an error arises: Эarray must be indexed (variable "-unknown-")"
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"));
Then the script will compile without errors. Thank you in advance for your help
why have the name stored, there's no noticeable benefit
just use conventional GetName

PHP код:
enum example {
    
myName[MAX_PLAYER_NAME]//not needed anymore
};
new 
myInfo[MAX_PLAYERS][example], testStr[MAX_PLAYER_NAME];
format(testStrsizeof(testStr), "%s"IsPlayerConnected(playerid) ? getName(playerid) : "Player is not connected");
getName(playerid)
{
    new 
n[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnMAX_PLAYER_NAME);
    return 
n;

done
Reply


Messages In This Thread
error 033 - by FelixAquero - 09.04.2018, 16:19
Re: error 033 - by CutX - 09.04.2018, 18:06
Re: error 033 - by FelixAquero - 09.04.2018, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)