parse() is a pretty bad function, I'd recommend not using it for anything personally... for 0.20 I've replaced it with a nicer function called strbreak().
The problem with parse is that it's not reentrant or loop-able, and your system of using like 30 skillx[2] variables is not the brightest idea either
Here is a suggestion, just make sure to reserve some extra memory for this plugin
Code:
#define MAX_SKILLS 41
//reserve 64K of memory
#pragma dynamic 16384
new playerid[32]
new playername[32]
new ip[32]
new xp[32]
new skills[MAX_SKILLS][2]
new pdata[512], i
new temp1[512], temp2[512]
get_vaultdata(pkey, pdata, 511)
str_break(pdata, playerid, temp1, 32, 511)
str_break(temp1, xp, temp2, 7, 511)
new s = strlen(temp2)
new j = 1, k = 0
for (i=0; i<s; i++)
{
//check for space or quote
if (temp2[i] == 32 || temp2[i] == 34)
j++
else
skills[j][k++] = temp2[i]
}
stock str_break(const String[], Left[], Right[], lMax, rMax)
{
new bool:quote_flag = false
new bool:done_flag = false
new left_pos = 0
new right_pos = 0
new i
new hold[] = "'^"x"
copy(Left, lMax, "")
copy(Right, rMax, "")
for (i=0; i<=strlen(String)-1; i++) {
if (equali(String[i], "^"", 1)) {
quote_flag = true
} else if ((equali(String[i], "^"", 1)) && (quote_flag)) {
quote_flag = false
}
if ((equali(String[i], " ", 1)) && (!quote_flag) && (!done_flag)) {
done_flag = true
i++
}
if (!done_flag && !equali(String[i], "^"", 1)) {
if (left_pos < lMax) {
setc(Left[left_pos], 1, String[i])
if (equali(Left[left_pos], "'", 1)) {
setc(Left[left_pos], 1, hold[1])
}
left_pos++
}
} else {
if (right_pos < rMax && !equali(String[i], "^"", 1)) {
setc(Right[right_pos], 1, String[i])
if (equali(Right[right_pos], "'", 1)) {
setc(Right[right_pos], 1, hold[1])
}
right_pos++
}
}
}
Left[left_pos] = 0
Right[right_pos] = 0
return true
}
I have no clue if this will work, but the idea is to make smart character parsing instead of relying on outside functions