https://community.bistudio.com/wiki/worldToScreen
_return = worldToScreen (getPos weaponOnGroundObject);
if ((count _return) == 0) then {
//weapon not on screen
} else {
//weapon is on screen or "spotted"
};
This code will query once to check if the player has the object in question on his screen or not. If you want to check it repeatedly then you can put it in a loop.