[Release] Telescopes

Telescopes

Showcase

Preview video (YouTube)
Nothing fancy, just a quick preview.

Imgur Album

About

Telescopes is a free standalone script that allows players to use telescopes all around the map. Currently, it allows the player to use /telescope, press E when close to one or to use either qTarget or qb-target as a 3rd eye solution.

Since I was unable to find a telescope scaleform in the game I had to do some trickery by overlaying two binocular scaleforms and some DrawRect() functions to make the illusion of a telescope lens. This might lead to some odd behaviour with ultra-wide screens.

Edit: Thanks to @CritteR for adding the correct scaleform and making it fit all screen resolutions.

I decided to release this to the public since I haven’t seen any other telescope scripts around. The script was made for fun, so the code might not be the greatest, feel free to improve upon it.

Optional Dependencies
As previously stated the script allows for either qTarget or qb-target to be used. They are disabled by default but can be toggled in the config file.

The script also uses mythic notify to send notifications to the player, however, this can be changed. Native notifications are built-in if you would like to use those instead. This can be toggled in the config file.

Optimization
The script runs at 0.01ms when idling if you have the help text thread (gets the distance to the telescope and displays some help text if close enough). It idles at 0.0 if you only use the command/3rd eye.

It runs at 0.04-0.05ms when using a telescope.

Known Issues
None as of now. Please report if you encounter any!
(the camera occasionally jumping out of the restricted view for telescopes heading north was resolved on the 19th of June, 2022).

Configuration
The script can be configured to a certain extent. You can see the config file below on Github.
Config file (GitHub)

Download

GitHub
Direct download: telescopes_1.4.1.zip (17.9 KB)

My other scripts
[Standalone] [Paid] Sit Anywhere
[Standalone] [PAID] Slash Tires
[Standalone] Crutches
[Release] No Exploding Pumps

22 Likes

Cool release!

I made a PR with the correct scaleform, if you want to look at it.

1 Like

Hey! Thanks,
I just merged the PR, it makes it look so much sharper!
I really do appreciate it!

Makes for a very nice addition to a server. Really cool idea.

awesome

For some reason when I use the telescope it just makes me get stuck in a black sceen and i have to log out out

Hello! Thats sad to hear, are you uisng the version from gihub or the direct download one? And is there any errors in the console?

I figured out the issue, I have other scripts that use scale forms and I guess there is a limit on how many there can be so I had to reduce the scale forms of another script and now everything works great :+1:t4:

This works with the mpsecurity gamebuild too in case anyone was wondering :slight_smile: Tried it out in the agencies and yup, works :stuck_out_tongue:

1 Like

I’ll guess I’ll leave a comment here just to let people know:

I did some small updates to the script, including fixing a small bug, adding a couple of extra checks and some general improvements to the code. It’s nothing huge but I do advise everyone who is using the script to update it. If you want to know all the details of what got updated you can go through the commit history on GitHub.

1 Like

Small update
Updated native names, fixed a broken function, removed two unused functions and cleaned up some variable names. You can find the details here on GitHub.

Update 1.4.0

I made quite a few changes to the script to keep it up-to-date.

Changelog:

  • Added support for using ox_target
  • Changed from enumerating to using the GetGamePool native (this also means that the script no longer relies on a prefixed list to show help text)
  • Changed the interaction distance from 1.5 to 1.75
  • Removed Citizen prefix
  • Removed config for notification (edit the function instead of that convoluted mess)
  • Some changes to the whitespace so it would look better on GitHub
  • (+) Some other small changes here and there

Update 1.4.1

Minor changes, mostly some refactoring.

Changelog:

  • Added a tilt check to prevent people from using telescopes that have been pushed over
  • The script changed from using 10ms in Wait() functions to using 0ms
  • Changed from precalculated hashes to backticks for easier readability
  • The camera , scaleform and instScaleform variables are now declared as int’s instead of nil
  • Some whitespace changes