[Error] Ajuda
#1

fui compilar o server e deu
Код:
(13480) : error 021: symbol already defined: "strtok"
(13495) : error 047: array sizes do not match, or destination array is too small
oq esta em volta й
Код:
	Checkprop();
	format(string, sizeof(string), "Loteria: Ja comecou a loteria.");
	OOCOff(COLOR_WHITE, string);
	new rand = random(80);
	if(rand < 77) { rand += 3; }
	Lotto(rand);
	return 1;
}
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
vlw ai gente
Reply
#2

Deleta a strtok do seu GM pois vocк deve ter outro em uma das suas includes ou no prуprio GM e troque new result[20] por new result[128];.
Reply
#3

pawn Код:
stock strtok(cmdtext[],param = 1)
{
    new iLoop = 0,iSpaces = 0,iStr[32];
    while(iSpaces != param) if(cmdtext[++iLoop] == ' ') ++iSpaces;
    ++iLoop,format(iStr,32,cmdtext[iLoop]);
    return iStr;
}
Й mais rбpido.
Reply
#4

Muda pra isso tbm funciona :
pawn Код:
Checkprop();
    format(string, sizeof(string), "Loteria: Ja comecou a loteria.");
    OOCOff(COLOR_WHITE, string);
    new rand = random(80);
    if(rand < 77) { rand += 3; }
    Lotto(rand);
    return 1;
}
strtok2(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
e so mudar de Strtok para Strtok2
Reply
#5

ae deu gente vlw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)