Why doesn't the percent sign (%) show in the chat? -
Jesant13 - 10.07.2010
While on the forum of a server I use, I saw that someone had created a thread saying that the percent sign doesn't show up in the chat. I joined a server I regularly use and logged in, and then typed % in the chat and pressed the enter key. I saw my name in the chat but only empty space next to it.
Does anyone know the answer? I do recall something about a certain character not being usable in the chat - I think it was because of a security-related issue - but I'm not sure.
Re: Why doesn't the percent sign (%) show in the chat? -
HydraX - 10.07.2010
Security Issue with coding.
Re: Why doesn't the percent sign (%) show in the chat? -
Jesant13 - 10.07.2010
Ah, okay thank you.
Re: Why doesn't the percent sign (%) show in the chat? -
BP13 - 10.07.2010
Really annoying. This can't be fixed?
Re: Why doesn't the percent sign (%) show in the chat? -
-Sneaky- - 10.07.2010
Quote:
Really annoying. This can't be fixed?
|
Well not really afaik else they would've fixed it already? Anyways you can use % in your gamemode for example like this:
pawn Код:
new String[128];
format(String, sizeof(String), "100%s", "%%");
SendClientMessage(playerid, 0xFFFFFFAA, String);
This would show in the chat: 100%
'%' get's replaced by '#' right or was it '?'? Perhaps you can fetch '#' or '?' under OnPlayerText then replace it with % using the above method but I never tried that.
Re: Why doesn't the percent sign (%) show in the chat? -
ev0lution - 10.07.2010
I think in <0.2X it was replaced with '?', now it's replaced with a space.
I don't see why it's not fixable though, the server could replace it with '%%' if it's being formatted.
Re: Why doesn't the percent sign (%) show in the chat? -
Hiddos - 10.07.2010
You could try doing a lot of stuff with strfind though, and replace the string.
From the wiki:
Quote:
%% Inserts the literal '%
|
I'm unsure if it'd detect the % sign at OnPlayerText though. If so, try using strins to insert the '%%' into his msg?
Re: Why doesn't the percent sign (%) show in the chat? -
d0 - 10.07.2010
if a player enters things like %d, %f or %s then they could fuck up all the
formated strings.
That is the reason why it got blocked. And replacing % with %% wouldn't help(still %%s).
Replacing it with a secret text serversided could work and then a clientsided script wich replaces this text again with a '%'.
Re: Why doesn't the percent sign (%) show in the chat? -
Simon - 10.07.2010
Quote:
Originally Posted by D0erfler
and replacing % with %% wouldn't help(still %%s).
|
Did you try this? The reason '%%' is there is so '%' appears in a formatted string. '%' is merely an escape character like '\' is an escape character for Pawn strings which you escape with '\\'.
I would like to see '%' allowed back in chat again. It's easy to make counter measures against format attacks by filtering the string before parsing it into format, any half-decent scripter would know how to do this. I'm sure someone would post a generic function to do this for newbies anyhow.
http://en.wikipedia.org/wiki/Format_string_attack
Re: Why doesn't the percent sign (%) show in the chat? -
Vince - 10.12.2015
The answer is given on a silver platter, right here in this topic:
Quote:
Originally Posted by d0
if a player enters things like %d, %f or %s then they could fuck up all the formated strings.
That is the reason why it got blocked. And replacing % with %% wouldn't help(still %%s).
|
What more explanation do you need?