View Single Post
  #5  
Old 07-19-2011, 09:59 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by cbk1994 View Post
Something like this is generally preferable to the above as it's not using old Gscript. Note that it will only work online.

PHP Code:
function onCreated() {
  
this.dontBlock();
}

//#CLIENTSIDE
function onCreated() {
  
this.dontBlock();
  
this.drawOverPlayer();
  
  if (
lighteffectsenabled) {
    
this.setColorEffect(0100.8); // red, green, blue, alpha
  
} else {
    
this.hide();
  }

Give it an image (usually light2.png or light3.png).
Not really that important especially with it only being an example but just for the sake of giving others the idea, if you are using dontblock serverside you don't need to be using it clientside, the same would also apply with drawoverplayer and most of the variable setting functions as the data is synchronised.
In theory it's better to have all of these serverside in the event of it being a static (motionless for example) NPC such as a light, this way it's only the specific variables being sent to clients rather than the script itself, which involves less data transfer.
Reply With Quote