you could make some kinda break char and break the string to 5 arrays or something.
string[] = "lol|w/e|and so on|forever"
And break them at that '|' to separate them.
EDIT:
For example you have this string
Code:
new string[] = "lol|lol2k|wazza"
you want to separate them using | as a separator. then you do this.
Code:
#include <amxmodx>
public func() {
new output[5][10] // 5 strings with len 9.
new string[] = "lol|lol2k|wazza"
explode(string, output, 9, '|')
}
/*
The last arg is to detect how big the output array is.
AFAIK this is the only way to do that ( automaticly ).
Of course you can still change it if you for some reason just want the first four or five inputs.
*/
stock explode(const input[], output[][], const len, const delim, const arraysize=sizeof output) {
new pos, cur, len2, maxlen = strlen(input)
while ( pos < maxlen && cur < arraysize && len2 < len ) {
if ( input[pos] != delim ) {
output[cur][len2] = input[pos]
len2++
}
else if ( strlen(output[cur]) ) {
cur++
len2 = 0
}
pos++
}
return cur
}
Output would be:
Code:
output[0] = "lol"
output[1] = "lol2k"
output[2] = "wazza"
And the function returns the number of strings separated.