16.01.2013, 08:13
What will happen if someone do this:
Someone types:
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.
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.
}
Код:
(#)s
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.