Thread: goggles
View Single Post
  #2  
Old 01-17-2006, 11:45 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
To get rid of it showing NPCs, in the for loop try checking to make sure the player's ID is > -1 (since 'character' NPC ids are -1). You can accomplish this by using:
PHP Code:
if (players[this.i].id > -1
NOTE: On a GS2 enabled server (and with v4), I do not think that NPCs are included in the players array.

As for your problem with a player seeing the light around himself, I believe that the first person in the players array (clientside) is yourself. So start the for loops at 1 (NOTE: I am not certain about this, but try if you are willing ).

Also, it's probably best to have only one if (weaponfired) block. For example:
PHP Code:
if (weaponfired) {
   if (
this.inuse == 0) {
     
//Stuff
   
}
   else {
     
//Stuff
   
}

__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote