array index out of bounds Error.
#7

Код:
stock CreateGang(name[MAX_GANG_NAME],owner[MAX_PLAYER_NAME])
{
    new string[256],File:hFile;
	for(new i = 0; i < MAX_GANGS; i++)
	{
	    format(string, sizeof(string), "/gangs/%d.gang", i);
	    if(!fexist(string))
	    {
	        hFile = fopen(string, io_write);
	        format(string, sizeof(string), "%s|%s", name,owner);
	        fwrite(hFile, string);
	        fclose(hFile);
	        Gangs[i][gName] = name;
	        Gangs[i][gOwner] = owner;
	        hFile = fopen("ganglog.log", io_append);
			format(string, sizeof(string), "Gang %d added: %s|%s", i, name,owner);
			fwrite(hFile, string);
			fclose(hFile);
			return i;
	    }
	}
	return -1;
}
Here you go.
Reply


Messages In This Thread
array index out of bounds Error. - by Gforcez - 15.07.2010, 14:16
Re: array index out of bounds Error. - by armyoftwo - 15.07.2010, 14:25
Re: array index out of bounds Error. - by Gforcez - 15.07.2010, 14:28
Re: array index out of bounds Error. - by MadeMan - 15.07.2010, 14:45
Re: array index out of bounds Error. - by Gforcez - 15.07.2010, 16:08
Re: array index out of bounds Error. - by MadeMan - 15.07.2010, 16:09
Re: array index out of bounds Error. - by Gforcez - 15.07.2010, 17:00
Re: array index out of bounds Error. - by [HUN]Jaki - 15.07.2010, 17:39
Re: array index out of bounds Error. - by [HiC]TheKiller - 15.07.2010, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)