Well, Era's Battle of the Bands is today and we were discussing that spamming could disrupt the event, or lag the level more (since there's going to be a bunch of people there).
So I made this simple toggle-able level mute NPC to throw down and solve the problem.
He said he wouldn't use it because the Timeout would "Lag the server".
I don't understand how? So if anyone could explain... as well as comment on how I could possibly code this better?
Thanks:
PHP Code:
function onCreated()
{
setTimer( 0.05 );
this.on = 0;
}
//#CLIENTSIDE
functon onPlayerEnters()
{
if ( this.on == 1 )
{
if ( player.guild != "Judge" || player.guild != "Preformer" )
{
player.chat = "...";
}
}
setTimer( 0.05 );
}
function onPlayerChats()
{
if ( player.guild == "Judge" )
{
if ( player.chat == ":muteon" )
{
this.on = 1;
player.chat = "Level-Mute Enabled";
}
elseif ( player.chat == ":muteoff" )
{
this.on = 0;
player.chat = "Level-Mute Disabled"
}
}
if ( this.on == 1 )
{
if ( player.guild != "Judge" || player.guild != "Preformer" )
{
if ( player.chat != "..." )
{
player.chat = "...";
}
}
}
setTimer( 0.05 );
}
function onTimeout()
{
if ( this.on == 1 )
{
if ( player.guild != "Judge" || player.guild != "Preformer" )
{
player.chat = "...";
}
}
setTimer( 0.05 );
}