Jump to content

Question

Posted

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;
}
G:\X.rar\gamemodes\X.pwn(9697) : error 021: symbol already defined: "strtok"
G:\X.rar\gamemodes\X.pwn(9712) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors

Linia 9697 - { de sub strtok

Linia 9712 - return result

3 answers to this question

Recommended Posts

Posted

Ma uimiti pe zi ce trece

error 021: symbol already defined = Eroare 021: simbol deja definite (Google Tata)

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Bai, esti un geniu! Cum ai putut sa-ti dai seama? Stiu si eu ce inseamna "simbol deja definit", dar problema e ca eroarea a aparut dupa ce am adaugat un sistem de war! O sa ma uit mai atent la toate strtok, cu voi nu e de facut nimic :-j.

Ceea ce am g?sit:

OnPlayerCommandText:

cmd = strtok(cmdtext, idx);

apoi la fiecare comand? (aproape):

tmp = strtok(cmdtext, idx); ?i cam atât despre strtok. :| Unde dracu' e deja definit c? înainte astea mergeau perfect, iar sistemul care l-am adaugat eu nici macar nu con?inea strtok. :|

Posted

Se vede cine e geniua, daca tu cauti in alta parte strtok-ul.

Stergel pe asta, daca tot te crezi asa de tare in scripting si rau de gura.

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;

}

Cu noi nu e de facut nimica, poate tu nu intelegi diferenta dintre definit si folosit, deci esti batut in cap si ce treaba avem noi cu sistemul tau de war? Uitate mult si bine ca daca nu faci nimic, nimic vei rezolva.

Si nu mai comenta degeaba, ca daca stiai ce insemna eroarea acuma nu ma mai postati aici.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.