05.07.2011, 10:55
You're still not understanding what he said correctly, sscanf will automatically return the ID for you, it doesn't return a string with the "r" identifier, it returns an integer!
So change your command like so:
Furthermore I suggest you read up on the sscanf documentation available over at the topic for the plugin.
So change your command like so:
pawn Код:
CMD:pm(playerid, params[])
{
new message[100], id;
if (sscanf(params, "rs[100]", id, message))
return SendClientMessage(playerid, 0xFF9900, "Usage: \"/PM <name/part of name> <message>\"");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
new pname[MAX_PLAYER_NAME], msg[100], sendermsg[100];
GetPlayerName(playerid, pname, sizeof(pname));
format(msg, sizeof(msg), "PM from %s : %s", pname, message);
SendClientMessage(id, 0xFFFF00AA, msg);
format(sendermsg, sizeof(sendermsg), "Message sent !");
SendClientMessage(playerid, 0xFFFF00AA, sendermsg);
return 1;
}