Thread: goggles
View Single Post
  #1  
Old 01-17-2006, 11:05 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
goggles

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;
}

Attached Thumbnails
Click image for larger version

Name:	strangenpc.png
Views:	313
Size:	61.1 KB
ID:	34949  
Reply With Quote