Be more specific.
like take a cvar with a value of "12 34 56 78" and making it into an array like
array[0] = "12"
array[1] = "34"
array[2] = "56"
array[3] = "78"
If so then you can use this function for that.
Code:
stock ExplodeString( p_szOutput[][], p_iMax, p_szInput[], p_iSize, p_szDelimiter )
{
new iIdx = 0, l = strlen(p_szInput)
new iLen = (1 + copyc( p_szOutput[iIdx], p_iSize, p_szInput, p_szDelimiter ))
while( (iLen < l) && (++iIdx < p_iMax) )
iLen += (1 + copyc( p_szOutput[iIdx], p_iSize, p_szInput[iLen], p_szDelimiter ))
return iIdx
}
You call it like so.
Code:
new array[6][5] , szCvar[16]
get_cvar_string("mycvar" , szCvar , 15)
// For reference it works like this array[p_iMax][p_iSize+1]
ExplodeString(array , 6 , szCvar , 4 , ' ')