Stopping PMs
#3

I need to check if the receiver is ignoring the sender, so I used a two dimensional array.

Besides, that's not the problem, the SendClientMessage sends, but the PM gets sent aswell..

This is the whole callback:

pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
  if(dispm == true)
  {
    SendClientMessageToAllBut(playerid,COLOR_ORANGE,"PMs are disabled!");
    return 0;
  }
  if(ignoring[recieverid][playerid])
  {
    SendClientMessage(playerid,COLOR_RED,"This player is ignoring you!");
    return 0;
  }
  if(PMspam[playerid] == MAX_WARNS+1)
  {
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"%s has been kicked from the server (Reason: PM Spam)",pName);
    SendClientMessageToAllBut(playerid,COLOR_ORANGE,string);
    SendClientMessage(playerid,COLOR_RED, "You have been kicked for spam!");
    Kick(playerid);
  }
  if(PMspam[playerid] < MAX_WARNS && PMspam[playerid] > 0)
  {
    PMspam[playerid]++;
    KillTimer(PMspammer[playerid]);
    SendClientMessage(playerid,COLOR_RED,"DO NOT SPAM!");
    PMspammer[playerid] = SetTimerEx("PMunspam",PM_WAIT*1000, false, "i", playerid);
    return 0;
  }
  if(PMspam[playerid] == 0)
  {
    PMspam[playerid]++;
    KillTimer(PMspammer[playerid]);
    PMspammer[playerid] = SetTimerEx("PMunspam",PM_WAIT*1000, false, "i", playerid);
  }
  if(pmon[recieverid] == 0)
  {
    SendClientMessage(playerid,COLOR_RED,"ERROR: This player has disabled Private messages!");
    return 0;
  }
  #if PM_SOUND == 1
  if(pmallowed[recieverid] == 1)
  {
    PlayerPlaySound(recieverid,1085,0.0,0.0,0.0);
    PlayerPlaySound(recieverid,1085,0.0,0.0,0.0);
    PlayerPlaySound(recieverid,1085,0.0,0.0,0.0);
  }
  #endif
  return 1;
}
Reply


Messages In This Thread
Stopping PMs - by Mikep - 25.03.2009, 22:57
Re: Stopping PMs - by Pyrokid - 25.03.2009, 23:03
Re: Stopping PMs - by Mikep - 25.03.2009, 23:05
Re: Stopping PMs - by ICECOLDKILLAK8 - 25.03.2009, 23:12
Re: Stopping PMs - by Mikep - 25.03.2009, 23:14
Re: Stopping PMs - by Pyrokid - 25.03.2009, 23:23
Re: Stopping PMs - by Mikep - 25.03.2009, 23:26
Re: Stopping PMs - by ICECOLDKILLAK8 - 25.03.2009, 23:28
Re: Stopping PMs - by Mikep - 25.03.2009, 23:30
Re: Stopping PMs - by Dujma - 25.03.2009, 23:43

Forum Jump:


Users browsing this thread: 1 Guest(s)