[FilterScript] [FS]AntiSpam + AntiFlooding + PM
#6

Well it's not hard to make it yourself!

pawn Код:
new IgnorePM[MAX_PLAYER_NAME];
OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
        IgnorePM[playerid] = 1;
        return 1;
}
pawn Код:
CMD:pm(playerid, params[])
{
    new str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];

    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, COLOR_HERE, "/pm [ID] [MESSAGE]");
        return 1;
    }
    if(IgnorePM[id] == 0)
        return SendClientMessage(playerid, COLOR_RED, "That player is not accepting PM's at this time!");

    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "[Error]: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "[Error]: You cannot pm yourself!");
    {
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(stri, sizeof(stri), "PM To %s(%d): %s", Name2, id, str2);
        SendClientMessage(playerid, COLOR_HERE, stri);
        format(stri, sizeof(stri), "PM From %s(%d): %s", Name1, playerid, str2);
        SendClientMessage(id, COLOR_HERE, stri);
        printf("PM From %s to %s: %s", Name1, Name2, str2);
    }
    return 1;
}
pawn Код:
CMD:ignorepm(playerid, params[])
{
    if(IgnorePM[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_HERE, "You have disabled private messages and will no longer receive them!");
        IgnorePM[playerid] = 0;
    }
    else
    {
        SendClientMessage(playerid, COLOR_HERE, "You have enabled private messages and will receive them!");
        IgnorePM[playerid] = 1;
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
        IgnorePM[playerid] = 0;
        return 1;
}
Reply


Messages In This Thread
[FS]AntiSpam + AntiFlooding + PM - by Elmerz_com - 25.11.2010, 14:23
Re: [FS]AntiSpam + AntiFlooding + PM - by [SU]Balli - 25.11.2010, 14:55
AW: [FS]AntiSpam + AntiFlooding + PM - by [SU]Balli - 26.11.2010, 11:56
Re: [FS]AntiSpam + AntiFlooding + PM - by FreshDoubleX - 26.11.2010, 12:07
AW: [FS]AntiSpam + AntiFlooding + PM - by [SU]Balli - 26.11.2010, 12:40
Re: [FS]AntiSpam + AntiFlooding + PM - by FreshDoubleX - 26.11.2010, 15:19
Re: [FS]AntiSpam + AntiFlooding + PM - by Elmerz_com - 05.12.2010, 17:22
Re: [FS]AntiSpam + AntiFlooding + PM - by Zh3r0 - 05.12.2010, 17:42
Re: [FS]AntiSpam + AntiFlooding + PM - by InTeL_cOrE_i7 - 26.03.2013, 15:27
Re: AW: [FS]AntiSpam + AntiFlooding + PM - by InTeL_cOrE_i7 - 26.03.2013, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)