Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-30-2011, 08:19 PM
Supaman771 Supaman771 is offline
Posting The Truth
Supaman771's Avatar
Join Date: Feb 2008
Posts: 1,694
Supaman771 is a glorious beacon of lightSupaman771 is a glorious beacon of lightSupaman771 is a glorious beacon of light
Level-Mute

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()
{
  
setTimer0.05 );
  
this.on 0;
}

//#CLIENTSIDE
functon onPlayerEnters()
{
  if ( 
this.on == )
  {
    if ( 
player.guild != "Judge" || player.guild != "Preformer" )
    {
      
player.chat "...";
    }
  }
 
setTimer0.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 == )
  {
    if ( 
player.guild != "Judge" || player.guild != "Preformer" )
    {
      if ( 
player.chat != "..." )
      {
        
player.chat "...";
      }
    }
  }
 
setTimer0.05 );
}

function 
onTimeout()
{
  if ( 
this.on == )
  {
    if ( 
player.guild != "Judge" || player.guild != "Preformer" )
    {
      
player.chat "...";
    }
  }
 
setTimer0.05 );

__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.