13.04.2011, 15:13
you mean a /pm command?
I think this should work fine
pawn Код:
CMD:pm(playerid, params[]) {
new id;
if(sscanf(params, "us[128]", id, params)) {
if(id != INVALID_PLAYER_ID) {
new name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str1[128], str2[128];
GetPlayerName(playerid, name1, MAX_PLAYER_NAME);
GetPlayerName(id, name2, MAX_PLAYER_NAME);
format(str1, sizeof(str1), "PM send to %s: %s", name2, params);
SendClientMessage(playerid, COLOR_LIGHTBLUE, str1);
format(str2, sizeof(str2), "PM received from %s: %s", name1, params);
SendClientMessage(id, COLOR_LIGHTBLUE, str2);
}
else return SendClientMessage(playerid, COLOR_GREY, "Error: Player not found");
}
else return SendClientMessage(playerid, COLOR_ORANGE, "Syntax Error: /pm [playerid] [text]");
return 1;
}