This is an NPC for Infrared goggles, half of the script isn't here (the part for setting the colors, because we have a day/night system that needs to be countered). Anyway, it kinda works, my only problems with it is that it counts some NPCs as players, not just npcs with showcharacter, but also random ones without showcharacter. Also, players can see the glow around themselves, even if they aren't using goggles. Any suggestions?
NPC Code:
//#CLIENTSIDE
if(weaponfired && this.inuse==0)
{
this.inuse=1;
setstring client.infgoggles,1;
setplayerprop #P1,dr-hat008.png;
}
else if(weaponfired && this.inuse==1)
{
this.inuse=0;
setstring client.infgoggles,0;
setplayerprop #P1,;
seteffect 0,0,0,0;
hideimg 914775;
for(this.i=0;this.i<playerscount;this.i++)
{
hideimg this.i;
hideimg this.i+1;
}
timeout=0;
}
if(this.inuse==1 || timeout)
{
for(this.i=0;this.i=<playerscount;this.i++)
{
setstring client.players,#v(this.i);
showtext 914775,550,10,Arial,b,Players:#s(client.players);
changeimgzoom 914775,.5;
changeimgvis 914775,5;
showimg this.i,ion.gif,players[strtofloat(#s(client.players))].x+.5,players[strtofloat(#s(client.players))].y+.75;
changeimgcolors this.i,1,.25,.25,.99;
changeimgzoom this.i,2;
changeimgvis this.i,1;
}
timeout=.05;
}