View Single Post
  #3  
Old 10-17-2011, 05:49 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 Gunderak View Post
I wonder how many people have stolen this half working script..
It's a pretty poor and inefficient set of scripts.

Looking at NPC "trashspawner" you have multiple checks to determine the item where it's possible it will have already been determined.
This could be made more efficient by either using a switch statement or storing the item names and images within an array, and then retrieving this.array[this.spawn - 1];.
It also looks as if you're setting a 0.05 second timeout which shouldn't even work Serverside, where again you have a potentially unnecessary condition being checked where a conflicting condition could be true.

Within "gunderak_trashdrop" you are checking a server. variable Clientside when these are only readable Serverside.
It also appears as if you are communicating from Serverside to Clientside, and then back to Serverside just to increment a server. variable when this can be done at the point of dropping the NPC. Not only is this totally unnecessary and suggesting that you're not really aware of what you're doing, it will also result in a triggerserver for every single client that creates the NPC. It can also result in both the spawn and unspawn trigger being sent at the same time when (even if it was a good idea) you should only have one of these triggers occurring. Calling destroy(); Clientside will also only destroy the NPC on your client, you have no mechanism to permanently destroy the NPC and prevent it from loading on yours or other peoples clients.

You yet again within "-System/Trash" you have the potential for unnecessary condition checks where params[0] == "spawn" can be checked for despite params[0] == "unspawn" already being determined as true, albeit you don't need this trigger anyway.
Reply With Quote