06.08.2013, 07:47
Quote:
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! |
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(" "); } } }