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;
}
?y try to make a togmp (Private Message) system but i can't,??when the player sends me a private message I receive it when my / mp is disabled
2021-02-20, 08:17 AM
(This post was last modified: 2021-02-20, 08:20 AM by akosd127.)
maybe this
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; }
|