Error 033
#1

I have an error 033: array must be indexed (variable "fightstyle") problem.
Код:
new fightstyle[MAX_PLAYERS];
Im using Dini to save stats.
Код:
public OnPlayerConnect(playerid)
{
  	new file[MAX_PLAYER_NAME+5], name[MAX_PLAYER_NAME];
  	GetPlayerName(playerid, name, sizeof(name));
  	format(file, sizeof(file), "N.N.GangWar/users/%s.txt", name);
 	 dini_Int(file,"fightstyle");
 	 fightstyle[playerid] =dini_Int(file,"fightstyle");

	if(!fexist(file))
  {
   dini_Create(file);
   fightstyle[playerid] = 0;
  }
	return 1;
}
Than...
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
		if(strcmp(cmdtext, "/lol", true) == 0)
	{
        fightstyle = 3;
		            return 1;
		}
	return 1;
	}
Somewhere in script i have if fightstyle = 0 it does that and that and blah blah... whatever
And at end to save fightstyles number...
Well i get that error in line "fightstyle = 3;"
No idea why.
EDIT: there is no difference if i change "fightstyle = 3;" to "fightstyle == 3;" not at error problem
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/lol", true) == 0) {
        fightstyle[playerid] = 3;
        return 1;
    }
    return 1;
}
Reply
#3

yep,found it by myself -.-

ty anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)