Block-Player From Public-Chat

Started by Saiyan Attack, Sep 17, 2016, 01:54 PM

Previous topic - Next topic

Saiyan Attack

Hello Everyone !!

I want to know that is possible to block a player from public chat ... for example if player1 abuse player2 and player2 want to block player1 then player1 message didn't received player2 but other players can read their messages ... is it possible   if yes than how ??

Shovon^

U can use mute and unmute script
Iam the best and i only believe in Allah

Conatact me here on IRC:  #shovon^ @LUnet

Saiyan Attack

#2
@vito would you please provide an example that how can i make ??

@Shovon^ player2 don't want to block him from whole chat  he just want to block him from his own screen ...

EK.IceFlake

Use Return 0; And Loop For Players Who Have Him Ignore Dont Send His Message Otherwise Use MessagePlayer

KAKAN

meh, you're using player.ID in the command. That's the big deal. Here's a simple code to make you understand.
http://pastebin.com/xy1T2hgZ
oh no

Saiyan Attack

#5
Sorry For Late Reply !!

@Kakan Your Example Is Good But It Doesn't Work For This Matter Becoz true false will never judge that who block which person ... just think about it if i make this like that block [nickid] ... or make a loop function for onplayerchat will result is which person have true he gone to true ... and which person have false he gone to false ... if anything that i can't understand about it you can tell me ...

Sorry For My Bad English :( ...

Mötley

KAKAN Is correct.

Once you write a mute function you will always have it, What I do is I Add a mute to my player loop method, Typically I will mute the player for one minute.

Once the player is muted make sure to decrease the time,

Example of decreasing the time in a loop.
I wont say this will work this is just an example,
With a little playing around it will work.
if (PClass[player.ID].Muted > 0)
{
 PClass[player.ID].Muted--;
  if (PClass[player.ID].Muted == 0)
  {
    //He is now unmuted
  }
}           
Now you can add the value from the class PClass[player.ID].Muted to a players account,
This will prevent mute evaders from leaving and rejoining to evade a mute. "I consider this troll methods :P FUN :D"

function onPlayerChat(player, text) {
  //Hes still muted
  if (PClass[player.ID].Muted > 0) return 0;
 
  return true;
}
Now I will not teach you how to return the time in a message for hours minutes seconds etc. As this becomes complicating for certain individuals to understand.

KAKAN

use time() instead :p
Instead of saving boolean values on the array, save the time( time() + 30 ), check it when a player chats, if it's more than the current time, he's still muted, if not, he is unmuted.
oh no

vito

I think he wants /ignore not /mute

Saiyan Attack

#9
Owh thanks @vito finally you understand what i want :) ... with mute system i can't judge how to make block/ignore system ... But Now I Understand how to deal with this function ... Thanks @EK.CrystalBlue and @KAKAN and @Mötley for your help and support :) ...

Topic Locked !!