listitem name
#1

Hey,

why doesn't this work?
Код:
enum l_data{//listitem
	listname[MAX_FRAK_LEN],
	bool:used = false
}

new list[MAX_LIST][l_data];
//..
for(new i = 0;i < Fraks; i++)
	{
		format(string,sizeof(string),"%s%s | "#HEXBlue"%s\n",string, fraktion[i][f_name], fraktion[i][f_leader]);
		format(list[i][listname], MAX_FRAK_LEN, fraktion[i][f_name]);
		list[i][used] = true;
                printf("%s",list[i][listname]); // -> Output is okay.
	}
	

//.. OnDialogResponse
new len = CountActiveList() - 1;
			printf("%d", len);
			new string[200];
			printf("%d",listitem);
			if(listitem <= len) 
			{
				printf("%s",list[listitem][listname]); // Output is wrong. Just random chars
				var[playerid][sList] = listitem;
				
			}
			else if(listitem == (len + 1))
			{
			   	printf("%d | %d", listitem, len);
			    print("add");
			}
			
			else if(listitem >= (len + 2))
			{
			    printf("%d | %d", listitem, len);
			    print("Delete");
			}

stock CountActiveList()
{
	new count;
	new i = 0;
	for(;i < MAX_LIST; i++ )
	{
	    if(list[i][used] == false)continue;
	    count ++;
	}
	return count;
}
Seems like something is wrong with the listitem.
Reply


Messages In This Thread
listitem name - by yellow - 28.03.2015, 21:04
AW: listitem name - by yellow - 29.03.2015, 15:19
AW: listitem name - by yellow - 30.03.2015, 14:44
AW: listitem name - by Kaliber - 30.03.2015, 15:33

Forum Jump:


Users browsing this thread: 1 Guest(s)