10.03.2017, 07:23
Hey guys how to remove element array and re-index in pawn ?
Example array:
new example_array_number = 0;
array[0] = 69; example_array_number++;
array[1] = 24; example_array_number++;
array[2] = 47; example_array_number++;
array[3] = 34; example_array_number++;
array[4] = 57; example_array_number++;
array[5] = 70; example_array_number++;
array {
0: 69,
1: 24,
2: 47,
3: 34,
4: 57,
5: 70
};
And I need to remove 2. element in array (47)
And how to create script after remove array look this:
array {
0: 69,
1: 24,
2: 34,
3: 57,
4: 70
};
Maybee for loop ?
for(new i=idk; i<example_array_number; i++) {
//reindex_stuff...
}
example_array_number--;
Please help! Sorry I have very bad english skill so I hope u will be understand.
Example array:
new example_array_number = 0;
array[0] = 69; example_array_number++;
array[1] = 24; example_array_number++;
array[2] = 47; example_array_number++;
array[3] = 34; example_array_number++;
array[4] = 57; example_array_number++;
array[5] = 70; example_array_number++;
array {
0: 69,
1: 24,
2: 47,
3: 34,
4: 57,
5: 70
};
And I need to remove 2. element in array (47)
And how to create script after remove array look this:
array {
0: 69,
1: 24,
2: 34,
3: 57,
4: 70
};
Maybee for loop ?
for(new i=idk; i<example_array_number; i++) {
//reindex_stuff...
}
example_array_number--;
Please help! Sorry I have very bad english skill so I hope u will be understand.