error 033: array must be indexed (variable "raison")
#1

I try to make something for offline players...
But it have a error;
"error 033: array must be indexed (variable "raison")"
Please tell me how to fix it :d
Код:
CMD:szcz2(playerid, params[])
{
                    new raison[41], cible[MAX_PLAYER_NAME];
                    if(sscanf(params,"s[24]s[40]",cible,raison)) return SendClientMessage(playerid, -1, "/szcz2 [name] [var]");
                    new filename2[50];
           			format(filename2, sizeof(filename2), "/FantasyLandUsers/%s.ini", cible);
           			if(!fexist(filename2)) return ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "错误", "没有这个玩家的数据", "Okay", "");
           			else
           			{
              			 new INI:File = INI_Open(filename2);
              			 new var = dini_Int(filename2,"Int");
              			 var=var+raison;   //this error
               		  	 INI_SetTag(File, "data");
              			 INI_WriteInt(File, "CZ", var);
               			 INI_Close(File);
           			}
           			return 1;
}
Reply
#2

no anyone?
Reply
#3

You already assigned something to "var" here "new var = dini_Int(filename2,"Int");" , then y are you assigning something else to var here? var=var+raison; . I think thats the issue , you could try replacing
PHP код:
var=var+raison;
to 
new "variable name"=var+raison
Because variables are containers so it can hold one at a time.

Aren't you trying to save a string? you cant do it like that
Reply
#4

Cant copy strings like that.

Use strins - https://sampwiki.blast.hk/wiki/Strins
or
Use strcat - https://sampwiki.blast.hk/wiki/Strcat
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)