16.03.2015, 15:10
Podes usar sscanf ou essa funcao:
PHP код:
db_get_field_assoc(Resultado,"Fome", Campo, 50);
new arrayp[2][8];
split(Campo, arrayp, '/');
Contas[playerid][Fome] = strval(arrayp[0]);
Contas[playerid][FomeMaximo] = strval(arrayp[1]);
stock split(const strsrc[], strdest[][], delimiter) // By Y_Less
{
new i, li, aNum, len;
while(i <= strlen(strsrc))
{
if(strsrc[i]==delimiter || i==strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}