07.09.2014, 13:25
do this will work!
Код:
dcmd_pm(playerid, params[]) { if(PlayerInfo[playerid][pLevel] < 1) { SendClientMessage(playerid, COLOR_WHITE, "You need level 2 to use this"); return 1; } if(PlayerInfo[playerid][pHelper] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, "you are not a helper."); return 1; } new pID, text[128], string[128]; if(sscanf(params, "us", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /pm (nick/id) (message) - Enter a valid Nick / ID"); if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected."); if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself."); format(string, sizeof(string), "%s (%d) is not accepting private messages at the moment.", PlayerName(pID), pID); if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string); format(string, sizeof(string), "(( PM to %s: %s ))", PlayerName(pID), text); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "(( PM from %s: %s ))", PlayerName(playerid), text); SendClientMessage(pID, COLOR_YELLOW, string); pInfo[pID][Last] = playerid; return 1; }