Need help with /reply and /ignore
#2

pawn Код:
new LastPM[MAX_PLAYERS] = -1;

    CMD:privatemessage(playerid,params[])
    {
        new targetid, msg[256];
        if(sscanf(params, "us[256]", targetid, msg)) return SendClientMessage(playerid, LIGHTBLUE,"[ USAGE: /privatemessage (name/id) (Message) ]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, red, "[ ERROR: Player is not online! ]");
        if(pm[targetid] == false) return SendClientMessage(playerid, red,"[ ERROR: Player has blocked private messages! ]");
        if(targetid == playerid) return SendClientMessage(playerid, red, "[ ERROR: You can't send private message to yourself! ]");
        new string[256], Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(targetid, Name2, sizeof(Name2));
        format(string, sizeof(string),"Private Message from %s(%d): %s", Name1, playerid, msg);
        SendClientMessage(targetid,COLOR_PINK, string);
        format(string, sizeof(string),"Private Message sent to %s(%d): %s", Name2, targetid, msg);
        SendClientMessage(playerid,COLOR_PINK, string);
        new File:file=fopen("/Database/Logs/PrivateMessageChatLog.log", io_append), hour, minute, second, year, month, day;
        LastPM[targetid] = playerid;
        gettime(hour, minute, second);
        getdate(year, month, day);
        format(string, sizeof(string), "[%d/%d/%d | %d:%d:%d] [ %s to %s: %s ]\r\n", day, month, year, hour, minute, second, Name1, Name2, msg);
        fwrite(file, string);
        fclose(file);
        return 1;
    }

    CMD:reply(playerid,params[])
    {
        new targetid = LastPM[playerid], msg[256];
        if(sscanf(params, "s[256]", msg)) return SendClientMessage(playerid, LIGHTBLUE,"[ USAGE: /privatemessage (name/id) (Message) ]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, red, "[ ERROR: Player is not online! ]");
        if(pm[targetid] == false) return SendClientMessage(playerid, red,"[ ERROR: Player has blocked private messages! ]");
        if(targetid == playerid) return SendClientMessage(playerid, red, "[ ERROR: You can't send private message to yourself! ]");
        new string[256], Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(targetid, Name2, sizeof(Name2));
        format(string, sizeof(string),"Private Message from %s(%d): %s", Name1, playerid, msg);
        SendClientMessage(targetid,COLOR_PINK, string);
        format(string, sizeof(string),"Private Message sent to %s(%d): %s", Name2, targetid, msg);
        SendClientMessage(playerid,COLOR_PINK, string);
        new File:file=fopen("/Database/Logs/PrivateMessageChatLog.log", io_append), hour, minute, second, year, month, day;
        LastPM[targetid] = playerid;
        gettime(hour, minute, second);
        getdate(year, month, day);
        format(string, sizeof(string), "[%d/%d/%d | %d:%d:%d] [ %s to %s: %s ]\r\n", day, month, year, hour, minute, second, Name1, Name2, msg);
        fwrite(file, string);
        fclose(file);
        return 1;
    }

    CMD:blockprivatemessage(playerid, params[])
    {
        if(pm[playerid] == false)
        {
            pm[playerid] = true;
            SendClientMessage(playerid, -1,"{A90202}[ You have turned on receiving private messages, you will receive private messages now! ]");
        }
        else
        {
            pm[playerid] = false;
            SendClientMessage(playerid, -1,"{A90202}[ You have turned off receiving private messages, you will no longer receive private messages! ]");
        }
        return 1;
    }
here is /reply cmd, what does /ignore do?
Reply


Messages In This Thread
Need help with /reply and /ignore - by Sc0pion - 14.03.2015, 16:06
Re: Need help with /reply and /ignore - by ReD_HunTeR - 14.03.2015, 19:46
Re: Need help with /reply and /ignore - by Sc0pion - 14.03.2015, 20:24
Re: Need help with /reply and /ignore - by ReD_HunTeR - 14.03.2015, 20:36
Re: Need help with /reply and /ignore - by Sc0pion - 14.03.2015, 21:55
Re: Need help with /reply and /ignore - by iFiras - 15.03.2015, 00:57

Forum Jump:


Users browsing this thread: 1 Guest(s)