24.08.2012, 18:27
pawn Код:
CMD:pm(playerid, params[])
{
new str[512], str2[512], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, str2))
{
SendClientMessage(playerid, -1, "USAGE: /pm [ID] [Message]");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "WARNING: Player is not connected.");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "WARNING: You cannot pm to yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "(( PM to [%d] %s: %s ))", id, Name2, str2);
SendClientMessage(playerid, 0xFFBF00FF, str);
format(str, sizeof(str), "(( PM from [%d] %s: %s ))", playerid, Name1, str2);
SendClientMessage(id, 0xFFFF00FF, str);
}
return 1;
}