Preventing (stopping) private messages from going through
#1

How can I stop private messages from being sent using /pm or /msg? I can't seem to get this working.

Thx.
Reply
#2

public OnPlayerPrivmsg(playerid,recieverid,text[]){
return false;
}
Reply
#3

Tried that, it doesn't work.
Reply
#4

make
Код:
return false;
=
Код:
return 0;
and hope for the best :P
Reply
#5

Quote:
Originally Posted by r3gan
Tried that, it doesn't work.
What filterscript(s) are you using?
And show gamemode OnPlayerPrivmsg and command /msg.
Reply
#6

Quote:

new pm;

Quote:

if(strcmp(cmd, "/pmoff", true) == 0)
{
pm = 1;
SendClientMessage(playerid, COLOR_GREY, "PM's toggled off!");
}
return 1;
}


if(strcmp(cmd, "/pmon", true) == 0)
{
pm = 0;
SendClientMessage(playerid, COLOR_GREY, "PM's toggled on!");
}
return 1;
}

Then add like this to /pm or /msg
Quote:

if(pm == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Admin disabled PM's!");
return 1;
}
else if(pm == 0)
{
Reply
#7

Quote:
Originally Posted by -eXo
Quote:

new pm;

Quote:

if(strcmp(cmd, "/pmoff", true) == 0)
{
pm = 1;
SendClientMessage(playerid, COLOR_GREY, "PM's toggled off!");
}
return 1;
}


if(strcmp(cmd, "/pmon", true) == 0)
{
pm = 0;
SendClientMessage(playerid, COLOR_GREY, "PM's toggled on!");
}
return 1;
}

Then add like this to /pm or /msg
Quote:

if(pm == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Admin disabled PM's!");
return 1;
}
else if(pm == 0)
{
That would disable PMs for everyone, FYI.
Reply
#8

I'm trying to disable them in the OnPlayerPrivmsg() call back. Reason for this is that I have a /mute command to mute players, and when a player is muted I want to be able to stop him from sending private messages. I've tried return 0, return 1, return false, etc., etc. from within the OnPlayerPrivmsg() callback, nothing works.
Reply
#9

Quote:
Originally Posted by r3gan
I'm trying to disable them in the OnPlayerPrivmsg() call back. Reason for this is that I have a /mute command to mute players, and when a player is muted I want to be able to stop him from sending private messages. I've tried return 0, return 1, return false, etc., etc. from within the OnPlayerPrivmsg() callback, nothing works.
pawn Код:
public OnPlayerPrivMsg(etc..)
{
   if(muted function here == 1)) //checks if the player is muted
   {
      //the block message here
   }
   return 1;
}
Reply
#10

Quote:
Originally Posted by Karlip
pawn Код:
public OnPlayerPrivMsg(etc..)
{
   if(muted function here == 1)) //checks if the player is muted
   {
      //the block message here
   }
   return 1;
}
In your
pawn Код:
//the block message here
how would you prevent the message from being delivered?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)