12.03.2011, 19:47
pawn Код:
COMMAND:pm(playerid, params[])
{
new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "ds[128]", id, str2)) return SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "Usage: /pm (id) (message)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/pm : Bad player ID");
if(playerid == id) return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR, "You cannot PM yourself");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), ">> %s(%d): %s", Name2, id, str2);
SendClientMessage(playerid, PM_OUTGOING_COLOR, str);
format(str, sizeof(str), "** %s(%d): %s", Name1, playerid, str2);
SendClientMessage(id, PM_INCOMING_COLOR, str);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",str2);
}
return 1;
}