%s in SendClientMessage
#11

What will happen if someone do this:
pawn Код:
OnPlayerText(playerid, text[])
{
    new string[128] = ": ", name[MAX_PLAYER_NAME];
    strcat(string, text);
    for(new i = 0, k = strlen(string) - 2;i < k;i++)// Allows players to type % in chat
        if ((string[i] == '(') && (string[i + 1] == '#') && (string[i + 2] == ')'))
        {
            string[i] = '%';
            strdel(string, i + 1, i + 2);
        }
    GetPlayerName(playerid, name, sizeof(name));
    strins(string, name, 0);
    SendClientMessageToAll(playerid, 0xFFFFFFFF, string);// With custom player name, so SendPlayerMessageToAll isn't used.
}
Someone types:
Код:
(#)s
Or similar code in dialogs.
If someone do that, it may cause the problem. Using format will not fix the problem, because it still need SendClientMessageToAll to send the message, which is where the problem at.
By the way, PAWN don't have data type, but only tag. Thus 0 = 0x00000000 = black.
Reply


Messages In This Thread
%s in SendClientMessage - by Dan.. - 13.01.2013, 09:18
Re: %s in SendClientMessage - by Kwarde - 13.01.2013, 09:49
Re: %s in SendClientMessage - by CaHbKo - 13.01.2013, 10:24
Re: %s in SendClientMessage - by TheArcher - 13.01.2013, 13:06
Re: %s in SendClientMessage - by Dan.. - 13.01.2013, 13:41
Re: %s in SendClientMessage - by TheArcher - 13.01.2013, 14:11
Re: %s in SendClientMessage - by Skyrise - 16.01.2013, 02:34
Re: %s in SendClientMessage - by mastermax7777 - 16.01.2013, 05:03
Re: %s in SendClientMessage - by Neil. - 16.01.2013, 07:05
Re: %s in SendClientMessage - by RajatPawar - 16.01.2013, 07:11
Re: %s in SendClientMessage - by leong124 - 16.01.2013, 08:13
Re: %s in SendClientMessage - by Kwarde - 16.01.2013, 12:20
Re: %s in SendClientMessage - by kaisersouse - 16.01.2013, 12:43
Re: %s in SendClientMessage - by leong124 - 16.01.2013, 13:59
Re: %s in SendClientMessage - by liquor - 22.01.2013, 20:12
Re: %s in SendClientMessage - by RootKiller - 22.01.2013, 21:02
Re: %s in SendClientMessage - by Basssiiie - 22.01.2013, 22:03
Re: %s in SendClientMessage - by TheArcher - 22.01.2013, 22:29
Re: %s in SendClientMessage - by leong124 - 23.01.2013, 06:54
Re: %s in SendClientMessage - by Basssiiie - 23.01.2013, 21:40
Re: %s in SendClientMessage - by Dan.. - 24.01.2013, 14:25
Re: %s in SendClientMessage - by leong124 - 24.01.2013, 15:10

Forum Jump:


Users browsing this thread: 4 Guest(s)