Oh now I get it. And I hope I'll be able to explain the problem as English is not my own language.
I'll simplify what you've typed:
PHP Code:
formatex(string[pos], 32-pos, "%d %%", floatround(35.333));
client_print(0,print_chat,"%s",string);
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 6.0, 12.0,_ ,_ , -1);
show_hudmessage(0,string);
There is a major difference between this:
PHP Code:
client_print(0,print_chat,"%s",string);
and this:
PHP Code:
show_hudmessage(0,string);
You first pass your format to
formatex function. All %% will become %. Then you pass resulting string as a
string parameter to
client_print to print it. That's fine.
But when you pass a string into the
show_hudmessage, you don't pass it as a string parameter but
format itself! It means, that your % in string that was processed by vformat is processed again and is considered not as escape sequence but format initiator.
I assume the solution to that would be:
PHP Code:
set_hudmessage(255, 255, 255, -1.0,0.30 , 0, 6.0, 12.0, _,_ , -1);
show_hudmessage(0, "%s", string);
Check that out, I can't (falling asleep). Hope it helps.
__________________