20.12.2015, 14:38
Код:
CMD:pm(playerid, params[]) { new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME]; if(sscanf(params, "us", id, str2)) { SendClientMessage(playerid, 0xDDBD0BFF, "Usage: /pm <id> <message>"); return 1; } if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xDDBD0BFF, "ERROR: Player not connected"); if(playerid == id) return SendClientMessage(playerid, 0xDDBD0BFF, "ERROR: You cannot pm yourself!"); { GetPlayerName(playerid, Name1, sizeof(Name1)); GetPlayerName(id, Name2, sizeof(Name2)); format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2); SendClientMessage(playerid, 0xDDBD0BFF, str); format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2); SendClientMessage(id, 0xC0A50AFF, str); } return 1; }
Did I do something incorrectly?