Help with WatchPM Command
#4

pawn Код:
dcmd_pm(playerid, params[])
{
    new pID, text[128], string[128];
    if(sscanf(params, "us[128]", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /pm (nick/id) (message)");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not joined.");
    if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cant pm yourself.");
    format(string, sizeof(string), "%s (%d) not accepting private messages now.", PlayerName(pID), pID);
    if(PMInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
    format(string, sizeof(string), "PM Sent %s(%d): %s", PlayerName(pID),pID, text);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "PM %s(%d): %s", PlayerName(playerid),playerid, text);
    SendClientMessage(pID, COLOR_YELLOW, string);
    for(new i = 0; i != MAX_PLAYERS; i++)
    {
        if(PmWatch[i][playerid] == 1) // You were checking [playerid][i] instead of this.
        {
            format(string, sizeof(string), "[PM Watch] %s(%d) >> %s(%d): %s", PlayerName(playerid),playerid,PlayerName(pID),pID, text);
            SendClientMessage(i, COLOR_GREY, string);    
        }
    }
    PMInfo[pID][Last] = playerid;
    return 1;
}
This should probably work.
Reply


Messages In This Thread
Help with WatchPM Command - by Sensation - 18.04.2015, 07:11
Re: Help with WatchPM Command - by Sellize - 18.04.2015, 07:31
Re: Help with WatchPM Command - by Sensation - 18.04.2015, 08:20
Re: Help with WatchPM Command - by Stinged - 18.04.2015, 09:49
Re: Help with WatchPM Command - by Sensation - 18.04.2015, 16:17

Forum Jump:


Users browsing this thread: 1 Guest(s)