SA-MP Forums Archive
NightVision & Thermal Goggles - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NightVision & Thermal Goggles (/showthread.php?tid=151692)



NightVision & Thermal Goggles - Headshot1108 - 31.05.2010

How can I do that the goggles doesn't show up at all players but only on the player who have the goggle ?


Re: NightVision & Thermal Goggles - IcyBlight - 31.05.2010

As far as I know, they're pretty damned bugged, if they even work.


Re: NightVision & Thermal Goggles - Headshot1108 - 31.05.2010

Quote:
Originally Posted by IcyBlight
As far as I know, they're pretty damned bugged, if they even work.
I saw it on few servers that players has NightVision Goggles and they work only for the player.


Re: NightVision & Thermal Goggles - Grim_ - 31.05.2010

There's a released script to fix it on the forums.


Re: NightVision & Thermal Goggles - (.Aztec); - 31.05.2010

Quote:
Originally Posted by Grim_
There's a released script to fix it on the forums.
There is? I just searched, and only found a fake one- Same thing basically, but it's fake nonetheless.


Re: NightVision & Thermal Goggles - Grim_ - 31.05.2010

This works, tested it myself:
pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    switch(GetPlayerWeapon(playerid))
    {
      case 44, 45:
      {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((keys & KEY_FIRE) && (!IsPlayerInAnyVehicle(playerid)))
            {
              return 0;
            }
        }
    }
    return 1;
}



Re: NightVision & Thermal Goggles - (.Aztec); - 31.05.2010

Quote:
Originally Posted by Grim_
This works, tested it myself:
pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    switch(GetPlayerWeapon(playerid))
    {
      case 44, 45:
      {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((keys & KEY_FIRE) && (!IsPlayerInAnyVehicle(playerid)))
            {
              return 0;
            }
        }
    }
    return 1;
}
Interesting, thank you.


Re: NightVision & Thermal Goggles - Headshot1108 - 01.06.2010

Quote:
Originally Posted by Sky4D
Quote:
Originally Posted by Grim_
This works, tested it myself:
pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    switch(GetPlayerWeapon(playerid))
    {
      case 44, 45:
      {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((keys & KEY_FIRE) && (!IsPlayerInAnyVehicle(playerid)))
            {
              return 0;
            }
        }
    }
    return 1;
}
Interesting, thank you.
And then only I see my goggle ?


Re: NightVision & Thermal Goggles - DeathOnaStick - 01.06.2010

Quote:
Originally Posted by Headshot1108
Quote:
Originally Posted by Sky4D
Quote:
Originally Posted by Grim_
This works, tested it myself:
pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    switch(GetPlayerWeapon(playerid))
    {
      case 44, 45:
      {
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        if((keys & KEY_FIRE) && (!IsPlayerInAnyVehicle(playerid)))
            {
              return 0;
            }
        }
    }
    return 1;
}
Interesting, thank you.
And then only I see my goggle ?
Think so, and i think it should also work under OnPlayerKeyStateChange. All in all it's okay like that but i think it would be better to put it under OnPlayerKeyStateChange, because it's not called as often as OnPlayerUpdate, but that's your decision.


Re: NightVision & Thermal Goggles - MadeMan - 01.06.2010

Quote:
Originally Posted by DeathOnaStick
Think so, and i think it should also work under OnPlayerKeyStateChange. All in all it's okay like that but i think it would be better to put it under OnPlayerKeyStateChange, because it's not called as often as OnPlayerUpdate, but that's your decision.
OnPlayerUpdate must return 0