public Get_War3ft_Commands() { new path[64] format(path, charsmax(path), "%s",CMD_FILE) if (!file_exists(path)) { new error[100] formatex(error, charsmax(error), "Cannot load cmd file %s!", path) set_fail_state(error) return; } new linedata[1024], key[64], value[600], section new file = fopen(path, "rt") while (file && !feof(file)) { fgets(file, linedata, 1023) replace(linedata, 1023, "^n", "") if (!linedata[0] || linedata[0] == ';') continue; if (linedata[0] == '[') { section++ continue; } strtok(linedata, key, charsmax(key), value, 599, '=') trim(key) trim(value) switch (section) { case 1: { if (equal(key, "SHOPMENU_1")) format(g_szCommand_Shop[CMD_SHOPMENU_1],MAX_LENGTH-1,"%s",value) else if (equal(key, "SHOPMENU_2")) format(g_szCommand_Shop[CMD_SHOPMENU_2],MAX_LENGTH-1,"%s",value) } } } if (file) fclose(file) }