Block out the chat - 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: Block out the chat (
/showthread.php?tid=137449)
Block out the chat -
Packer5 - 28.03.2010
Hello
is there a function to make the chat invisible to a certain player?
AKA: Make it so that what people are saying doesn't appear on their chat.
Thanks
Re: Block out the chat -
RyDeR` - 28.03.2010
Код:
public OnPlayerText(playerid, text[])
{
return 0;
}
Re: Block out the chat -
Packer5 - 28.03.2010
thanks
Re: Block out the chat -
biltong - 28.03.2010
Quote:
|
Originally Posted by » RyDeR «
Код:
public OnPlayerText(playerid, text[])
{
return 0;
}
|
That means NOBODY will be able to chat at all. I think he wants for a specific player to not be able to see chat, and I don't think that's possible
Re: Block out the chat -
Nero_3D - 28.03.2010
Quote:
|
Originally Posted by biltong
Quote:
|
Originally Posted by » RyDeR «
Код:
public OnPlayerText(playerid, text[])
{
return 0;
}
|
That means NOBODY will be able to chat at all. I think he wants for a specific player to not be able to see chat, and I don't think that's possible 
|
sure it is, ever heard of a /mute command ?
pawn Код:
if((strcmp("mute", cmdtext[1], true, 4) == 0) && (cmdtext[5] == ' ' || cmdtext[5] == EOS))
{
if(cmdtext[5] == ' ')
{
if('0' <= cmdtext[6] && cmdtext[6] <= '9')
{
if(SetPVarInt(strval(cmdtext[6]), "Muted", 1))
return SendClientMessage(playerid, 0xFFFFFFAA, "Player muted!");
return SendClientMessage(playerid, 0xFFFFFFAA, "Invalid playerid!");
}
}
return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /mute [playerid]");
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid, "Muted")) return 0;
}
pawn Код:
if((strcmp("unmute", cmdtext[1], true, 6) == 0) && (cmdtext[7] == ' ' || cmdtext[7] == EOS))
{
if(cmdtext[7] == ' ')
{
if('0' <= cmdtext[8] && cmdtext[8] <= '9')
{
if(IsPlayerConnected((cmdtext[0] = strval(cmdtext[8]))))
{
if(GetPVarInt(cmdtext[0], "Muted"))
{
DeletePVar(cmdtext[0], "Muted");
return SendClientMessage(playerid, 0xFFFFFFAA, "Player unmuted!");
}
return SendClientMessage(playerid, 0xFFFFFFAA, "Player not muted!");
}
return SendClientMessage(playerid, 0xFFFFFFAA, "Invalid playerid!");
}
}
return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /unmute [playerid]");
}
Re: Block out the chat -
biltong - 29.03.2010
That will make sure he can't chat, but he will still be able to see other people's chat which is what I meant, him not being able to see other people's chat.
Re: Block out the chat -
Nero_3D - 29.03.2010
Ok, so with this he wont be able to see the text what other wrote (if Invisable isnt 0)
pawn Код:
public OnPlayerText(playerid, text[])
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i, "Invisible") == 0)
SendPlayerMessageToPlayer(i, playerid, text);
}
return 0;
}
But he still can write in the chatbox and other will see it (even he self doesnt)