replace_stringex does not seem to be working for me. It just removes the search string it doesn't replace it with the replacement string.
I tried it with replace and replace_string and both worked, that's why I figured something is wrong with replace_stringex.
PHP Code:
public test(id)
{
new test1[5] = "fool";
new test2[5] = "fool";
new test3[5] = "fool";
replace(test1, 4, "f", "c");
client_print(id, print_chat, "%s", test1);
replace_string(test2, 4, "f", "t");
client_print(id, print_chat, "%s", test2);
replace_stringex(test3, 4, "f", "p");
client_print(id, print_chat, "%s", test3);
}
Prints out:
I checked string.ccp and found that replace_stringex does:
PHP Code:
set_amxstring(amx, params[1], ptr, maxlength);
While with replace_string sets the text not ptr/count:
PHP Code:
set_amxstring(amx, params[1], text, maxlength);
That might be because of how they work, I can't tell but I figured I'd mention it anyway.