04.09.2018, 11:20
You're adding your entered location to every index of your GPS array, overwriting every previously added location.
You have to find a free spot and only add it to that free spot, then abort the loop.
Also, why store the name first, then store it a second time using format at the exact same field of your enum?
You have to find a free spot and only add it to that free spot, then abort the loop.
Also, why store the name first, then store it a second time using format at the exact same field of your enum?
PHP код:
GPS[i][loc_name] = name; // Store once
GPS[i][loc_x] = x;
GPS[i][loc_y] = y;
GPS[i][loc_z] = z;
format(GPS[i][loc_name],512, "%s", name); // Store again???