Enum Issue -
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
1) Your strings are 6 characters, not 5.

2) ENUMS. ARE. NOT. ARRAYS.

I wonder if there's a way to see how many HUNDREDS of times I've said that!
I changed it back to arrays, and look:

The result:

(There is more 10 codes in the array, I moved them out so it doesn't become too long.

The print for the TenCodes[i][1] isn't correct. It just prints the code without the 1, so 0-20, not the whole string.

[08:53:06] 20 - Found - Replacing 10-20 with 0-20 within hello 10-20

Код:
stock IncludeCodes(playerid, chattext2[])
{
	new chattext[180];

	format(chattext, sizeof(chattext), chattext2);

	for(new i = 0; i < sizeof(TenCodes); i++)
	{
		if(strfind(chattext, TenCodes[i][0], true) != -1)
		{
		    printf("%d - Found - Replacing %s with %s within %s", i, TenCodes[i][0], TenCodes[i][1], chattext);
            strreplace2(chattext, TenCodes[i][0], TenCodes[i][1],true);
            printf(" ");
		}
	}
}
Reply


Messages In This Thread
Enum Issue - - by Kyle - 05.08.2013, 23:53
Re: Enum Issue - - by Kyle - 06.08.2013, 07:47
Re: Enum Issue - - by NinjahZ - 06.08.2013, 09:46
Re: Enum Issue - - by Kyle - 06.08.2013, 12:27
Re: Enum Issue - - by Konstantinos - 06.08.2013, 12:55

Forum Jump:


Users browsing this thread: 1 Guest(s)