![]() |
goggles
1 Attachment(s)
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 |
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:
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:
|
Quote:
Quote:
Quote:
|
Quote:
But now I know what you mean. Use this.i + 300 (lower indexes are visible to all). |
Quote:
NPC Code://#CLIENTSIDE |
Quote:
NPC Code:showimg this.i + 300,ion.gif,players[strtofloat(#s(client.players))].x+.5,players[strtofloat(#s(client.players))].y+.75; |
:D Thanks, but I still can't get it to stop counting NPCs without going negative, i havn't changed the script I last posted, so far it's the one that gets closest, without a ton of lag
|
players[this.i].darts
NPCs normally don't carry around darts. |
huh? I don't need another thing to identify an NPC, the problem is, the weapon thinks that the NPC is included in playerscount, and therefore, it HAS to make this.i go up to that number, otherwise you have a never ending loop, with it being stuck at a number that may not be correct. I find that the NPC woeks in some levels, but not others, and the number is normally much higher than the actual number of NPCs in the level, (returning numbers like 600) what i need is for it to add 1 to a number each time it goes through the loop and finds an npc, then subtract that number from the playerscount (client.players) but when I try this, the loop becomes infinite, and the number becomes negative x_x
|
have you actually seen infrared goggles? when you actually look into them, the image is green XD
|
yeah, i should have called these thermal goggles, i plan to change the name. Anyway, I already have typical night vision gogles, this is an alternative, as night vision can be messed up by bright lights, and obstructions, like thick smoke, etc. whereas, this has a light that shows where each player is...and the number of players in the level, if I can fix that without lag x_X otherwise, I'll have to take it out.
|
PHP Code:
|
My eyes! The goggles, they...
http://img.photobucket.com/albums/v3...ogglescard.jpg |
All times are GMT +2. The time now is 10:40 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.