2021-02-19, 10:21 PM
PHP Code:
new B_Privados[MAX_PLAYERS];
CMD:togmp(playerid, params[]) {
? ? if (!B_Privados[playerid]) {
? ? ? ? B_Privados[playerid] = 1;
? ? ? ? SendClientMessage(playerid, 2, "MP OFF");
? ? } else if (B_Privados[playerid]) {
? ? ? ? B_Privados[playerid] = 0;
? ? ? ? SendClientMessage(playerid, 2, "MP ON");
? ? }
? ? return 1;
}
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]
PHP Code:
[/font][/size][/color]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");
? ? else{
? ? ? ? GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
? ? ? ? GetPlayerName(PmPlayer, PlayerName2, sizeof(PlayerName2));
? ? ? ? if (B_Privados[PmPlayer[0]] == 1) return SendClientMessage(playerid, 0, "This player has blocked the /mp");
? ? ? ? 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;
}