[Bug?] Percent character
#1

Can't get my percent character working anymore, currently using RC3 Server & RC3-3 Client.

ex.
pawn Код:
SendClientMessage( playerid, -1, "Hi there, you are 97%% homo.");
Before (0.3b) it would show up: 97%
Now (0.3c) it shows up as: 97
Reply
#2

Before in 0.3b using % in sendclientmessage would crash the server.
Reply
#3

So no way of using %?

Reply
#4

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
So no way of using %?

You can still use it in format() as far as I know, but according to this report, not alone in SendClientMessage().
Reply
#5

Actually I used it in format() and that's where it doesn't work. That SendClientMessage() was a random make-up - didn't test in it, but I guess there is no difference!?
Reply
#6

Quote:
Originally Posted by exora
Посмотреть сообщение
Actually I used it in format() and that's where it doesn't work. That SendClientMessage() was a random make-up - didn't test in it, but I guess there is no difference!?
Not exactly... If my "theory" is valid;

format() was coded to be capable for handling percentages for variables, whereas I don't believe that SendClientMessage() was, it just handles the data its given, and format compiles a string with the strings (if any) and text to send as a client message when used together.

format accepts %% insert a literal percentage, so SendClientMessage() would not (at least I think...) as it's just expecting a string with normal data to parse.

I don't quite understand why % wouldn't work in a SendClientMessage() execution though, if ^ is correct.
Reply
#7

+1.
Before 0.3b(and even 0.3C RC3-3), "%%" or "%" in SendClientMessage/Player Chat= nothing.
Seems that "%%" in format is usable before 0.3C RC3-3 but now it can't.
It can only be used in dialogs.
I still hope that can be fixed for sure.
Reply
#8

%% works for textdraws and dialogs, not sure about gametexts.

% just sends nothing in chat.
Reply
#9

If you are using SendClientMessage etc. to send a formatted string you need to use %%%%

new str[10]; format(str,sizeof(str),"%d %%%%",25);
SendClientMessage(playerid,0xFFFFFFFF,str);

^ Will output 25 % in game

If you put %% in your string, SendClientMessage interprets this as %, therefore not showing a % in game.

If you put %%%% in your string, SendClientMessage interprets this as %% and will then display a % in game.
Reply
#10

woah thanks CodeRae, I didn't think it was possible

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)