Preventing (stopping) private messages from going through - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Preventing (stopping) private messages from going through (
/showthread.php?tid=88080)
Preventing (stopping) private messages from going through -
r3gan - 24.07.2009
How can I stop private messages from being sent using /pm or /msg? I can't seem to get this working.
Thx.
Re: Preventing (stopping) private messages from going through -
yezizhu - 24.07.2009
public
OnPlayerPrivmsg(playerid,recieverid,text[]){
return false;
}
Re: Preventing (stopping) private messages from going through -
r3gan - 24.07.2009
Tried that, it doesn't work.
Re: Preventing (stopping) private messages from going through -
Annihalation - 24.07.2009
make
=
and hope for the best :P
Re: Preventing (stopping) private messages from going through -
yezizhu - 24.07.2009
Quote:
Originally Posted by r3gan
Tried that, it doesn't work.
|
What filterscript(s) are you using?
And show gamemode OnPlayerPrivmsg and command /msg.
Re: Preventing (stopping) private messages from going through -
-eXo - 25.07.2009
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)
{
|
Re: Preventing (stopping) private messages from going through -
Calgon - 25.07.2009
Quote:
Originally Posted by -eXo
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.
Re: Preventing (stopping) private messages from going through -
r3gan - 25.07.2009
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.
Re: Preventing (stopping) private messages from going through -
Karlip - 25.07.2009
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;
}
Re: Preventing (stopping) private messages from going through -
r3gan - 30.07.2009
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
how would you prevent the message from being delivered?