03.10.2010, 13:14
I have an error 033: array must be indexed (variable "fightstyle") problem.
Im using Dini to save stats.
Than...
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
Код:
new fightstyle[MAX_PLAYERS];
Код:
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; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/lol", true) == 0) { fightstyle = 3; return 1; } return 1; }
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