08.07.2012, 01:11
i think this should work
pawn Код:
dcmd_pm(playerid, params[])
{
new id, msg[148],str[148],str1[148];
if(sscanf(params, "us[81]", id, msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "/pm [player] [message]");
if(msg[80]) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(!strlen(msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
//if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
else
{
new sentname[MAX_PLAYER_NAME], recievedname[MAX_PLAYER_NAME];
GetPlayerName(playerid, sentname, sizeof(sentname));
GetPlayerName(id, recievedname, sizeof(recievedname));
format(str,sizeof(str),"PM Sent To %s(%d): %s", recievedname, id, msg);
format(str1,sizeof(str1),"PM From %s(%d): %s", sentname, playerid, msg);
SendClientMessage(playerid,0xFFFFFFFF,str);
SendClientMessage(id, 0xFFFFFFFF,str1);
}
return 1;
}