maybe this
but maybe this is a better solution
PHP Code:
CMD:mp(playerid, params[])
{
? ? new PmPlayer, Message[124], String[124], PlayerName[MAX_PLAYER_NAME], PlayerName2[MAX_PLAYER_NAME], PmSent[50];
? ? if (B_Privados[playerid] == 1) return SendClientMessage(playerid, 0, "You blocked the /mp");
? ? if (sscanf(params, "us[140]", PmPlayer, Message)) return SendClientMessage(playerid, 0xFFFFFFFF, "{D41818}[COMMAND]{AFAFAF} /mp <id> <text>");
? ? if (!IsPlayerConnected(PmPlayer)) return SendClientMessage(playerid, 0xFF0000FF, "{D41818}[ERROR]{AFAFAF} The player he's not connected");
? ? if (B_Privados[PmPlayer] == 1) return SendClientMessage(playerid, 0, "This player has blocked the /mp");
? ? GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
? ? GetPlayerName(PmPlayer, PlayerName2, sizeof(PlayerName2));
? ? format(PmSent, sizeof(PmSent), "MP sended to %s", PlayerName2);
? ? SendClientMessage(playerid, 0xfce80cff, PmSent);
? ? format(String, sizeof(String), "[MP - ID:%d] %s: %s",playerid,PlayerName, Message);
? ? SendClientMessage(PmPlayer, 0xfdfe8bff, String);
? ? printf("%s to %s, %s", PlayerName, PlayerName2, Message);
? ? return 1;
}
but maybe this is a better solution
PHP Code:
#define RED 0xD41818FF
CMD:mp(playerid, params[])
{
? ? new pmid, Message[128], String[128];
? ? if (B_Privados[playerid] == 1) return SendClientMessage(playerid, 0, "You blocked the /mp");
? ? if (sscanf(params, "us[140]", pmid, Message)) return SendClientMessage(playerid, RED, "[COMMAND]{AFAFAF} /mp <id> <text>");
? ? if (!IsPlayerConnected(pmid)) return SendClientMessage(playerid, RED, "[ERROR]{AFAFAF} The player he's not connected");
? ? if (B_Privados[pmid] == 1) return SendClientMessage(playerid, 0, "This player has blocked the /mp");
? ? format(String, sizeof(String), "[MP] %s(ID:%d) - %s(ID:%d): %s", PlayerName(playerid), playerid, PlayerName(pmid), pmid, Message);
? ? SendClientMessage(playerid, 0xfdfe8bff, String);
? ? SendClientMessage(pmid, 0xfdfe8bff, String);
? ? printf("%s to %s, %s", PlayerName(playerid), PlayerName(pmid), Message);
? ? return 1;
}
stock PlayerName(playerid)
{
new Player_Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Player_Name, sizeof(Player_Name));
return Player_Name;
}