Mute Problem - 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)
+--- Thread: Mute Problem (
/showthread.php?tid=634248)
Mute Problem - adri[4]Life - 15.05.2017
Hi Guys My Friend is having a problem On This Code:
Код:
public OnPlayerText(playerid, text[])
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, -1, "STFU");
}
return 1;
}
CMD:muteme(playerid,params)
{
muted[playerid] = 1;
return 1;
}
when someone types /muteme and chat in game, he still can shout and the STFU Msg goes up but my shout still could seen by everyone.
Re: Mute Problem -
jlalt - 15.05.2017
return 0; to prevent message from being sent so ->
PHP код:
public OnPlayerText(playerid, text[])
{
if(muted[playerid] == 1)
{
SendClientMessage(playerid, -1, "STFU");
return 0;
}
return 1;
}
CMD:muteme(playerid,params)
{
muted[playerid] = 1;
return 1;
}
Re: Mute Problem -
Logic_ - 15.05.2017
Or more simply...
PHP код:
if(muted[playerid]) return SendClientMessage(playerid, -1, "STFU!"), 0;
Under OnPlayerText.
Re: Mute Problem -
Juvanii - 15.05.2017
Quote:
Originally Posted by Logic_
Or more simply...
PHP код:
if(muted[playerid]) return SendClientMessage(playerid, -1, "STFU!"), 0;
Under OnPlayerText.
|
It also could be:
PHP код:
if(muted[playerid]) return !SendClientMessage(playerid, -1, "STFU!");