View Single Post
  #7  
Old 03-19-2010, 01:57 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by jkldogg View Post
okay, fine i want to learn
I don't understand this part: code..
Those are fail-safes.

if (!this.guildaccess) - Checks if the this.guildaccess is not 0

this.guildaccess = "Guild Name" - Sets this.guildaccess to a default value if it's not defined or equals 0.

this.setshape(1, 32, 32); - My example sets the size of the npc to a blocking type (1), and to block 32 by 32 pixels (or 2 by 2 tiles since tiles are 16 pixels in width and height).

Also, yes your script is relatively small, simple, quick but lacks reuse-ability and will be a pain to have to go and replace it everywhere it's used if you want to change it's behavior.

P.S. Don't leave the code in PHP tags in your quotes, just makes it easier on people tbh.
__________________
Quote:
Reply With Quote