FYI, still not good enough.
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Jim"
#define MAX_STRLEN 32
#define MAX_PLAYER 32
new Player_Steam[MAX_PLAYER][MAX_STRLEN]
new const test_string[3][] = {
"steam:1234567",
"steam:7654321|",
"steam:1234567|steam:7654321|steam:8888888"
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("test", "test")
}
public test(id) {
static j
new num = string_split(test_string[j++ % 3])
for(new i = 0; i < num; i++)
{
client_print(id, print_chat, Player_Steam[i])
}
return PLUGIN_HANDLED
}
public string_split(const source[])
{
new i, j, k, c
while((c = source[i++]))
{
if(j == MAX_PLAYER)
break
if(k < MAX_STRLEN && c != '|')
Player_Steam[j][k++] = c
else
{
Player_Steam[j][k] = 0
k = 0
j++
}
}
return !i ? 0 : (!j ? 1 : (!k ? j : j + 1))
}
doesn't contain the situation of "|steam:1234567"
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>