# AdvancedBlips

{% hint style="danger" %}

#### WE DONT PROVIDE ANY SUPPORT OF THIS TO USE. ITS A DEVELOPER RESOURCE NOT MEANT FOR PEOPLE WITHOUT DEV-KNOWLEDGE!&#x20;

#### FEEL FREE TO INTEGRATE IN YOUR SCRIPTS!

{% endhint %}

## Preview

<div align="left"><figure><img src="/files/1wkiR8qQsJPyehfyXuKW" alt=""><figcaption><p>Screenshot from MFP_Banking-Blip</p></figcaption></figure></div>

### Installation

Add this in your `server.cfg` above the resource using exports:

```
start mfp_blips 
start UR-RESOURCE
```

### Exports

**ResetBlipInfo(blip):** Clears all blip information and disables the information popup when selected.

**SetBlipInfoTitle(blip, title, rockstarVerified):** Defines the title for the information popup and toggles the Rockstar-verified icon.

**SetBlipInfoImage(blip, dict, tex):** Sets the header image for the information popup.

**SetBlipInfoEconomy(blip, rp, money):** Customizes the visual representation for RP and Money in the popup. Empty strings disable the respective icons.

**AddBlipInfoText(blip, leftText, rightText):** Appends a line of text to the information popup.

**AddBlipInfoName(blip, leftText, rightText):** Appends a line of text to the information popup, with the right text appearing in bold.

**AddBlipInfoHeader(blip, leftText, rightText):** Appends a line to the information popup, including a separator between this line and the previous one.

**AddBlipInfoIcon(blip, leftText, rightText, iconId, iconColor, checked):** Appends a line to the information popup, incorporating a blip icon. The `iconId` can range from 0 to 25, and `iconColor` appears to match with blip colors.

**SetBlipInfo(blip, infoData):** Sets the raw information data for advanced usage.

## Usage

```lua
exports['mfp_blips']:SetBlipInfoImage(blip, "texturename", "imagename") -- like imagename from imagename.dds or .jpeg, texturename from texturename.ytd. Dont insert formates!
exports['mfp_blips']:SetBlipInfoTitle(blip, "Title", true)
exports['mfp_blips']:SetBlipInfoEconomy(blip, "1 123", "4552")
exports['mfp_blips']:AddBlipInfoText(blip, "Text", "Your Text")
exports['mfp_blips']:AddBlipInfoName(blip, "Name", "mfpscripts.com")
exports['mfp_blips']:AddBlipInfoHeader(blip, "Header", "This is my own text")
exports['mfp_blips']:AddBlipInfoIcon(blip, "Blip", "Suit -->", 16, 0, true)
```

### IMPORTANT

If you want to use **banner img** make sure to stream the texture first! You need this inside your code when you want to use this

```lua
RequestStreamedTextureDict("texturename", 1)
while not HasStreamedTextureDictLoaded("texturename") do
    Wait(0)
end
```

You need to have a **texturename.ytd** in a stream folder in your resource. In this texturefile is your **image** locaded by default **its dds**, you can use *openiv* to just drag and drop a jpeg or png and its automaticly converted! After this just ad following to your handfull exports:

```lua
exports['mfp_blips']:SetBlipInfoImage(blip, "texturename", "imagename") 
-- like imagename from imagename.dds or .jpeg, texturename from texturename.ytd. 
-- Dont insert formates!
```

### 💸 EXAMPLE USED IN [MFP\_Banking](https://mfp.tebex.io/package/4880870)

```lua
Citizen.CreateThread(function()
	if not Config.EnableBlips then return end
	
	RequestStreamedTextureDict("banking_banner", 1)
    while not HasStreamedTextureDictLoaded("banking_banner") do
        Wait(0)
    end

	for _, BankLocations in pairs(Config.BankLocations) do
		BankLocations.blip = AddBlipForCoord(BankLocations.x, BankLocations.y, BankLocations.z)
		SetBlipSprite(BankLocations.blip, 108)
		SetBlipDisplay(BankLocations.blip, 4)
		SetBlipScale(BankLocations.blip, 0.9)
		SetBlipColour(BankLocations.blip, 0)
		SetBlipAsShortRange(BankLocations.blip, true)
		BeginTextCommandSetBlipName("STRING")
		AddTextComponentString(Translation[Config.Locale]['atm_blip'])
		EndTextCommandSetBlipName(BankLocations.blip)
		if Config.usingAdvancedBlips then
			exports['mfp_blips']:SetBlipInfoTitle(BankLocations.blip, Translation[Config.Locale]['atm_blip'], false)
			exports['mfp_blips']:SetBlipInfoImage(BankLocations.blip, "banking_banner", "fleeca")
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['times1_blip'], Translation[Config.Locale]['times2_blip'])
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['withdraw_blip'], Translation[Config.Locale]['yes_blip'])
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['sendmoney_blip'], Translation[Config.Locale]['yes_blip'])
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['employees_blip'], Translation[Config.Locale]['employees_amount_blip'])
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['place_blip'], Translation[Config.Locale]['place2_blip'])
			exports['mfp_blips']:AddBlipInfoHeader(BankLocations.blip, "") -- Empty header adds the header line
			exports['mfp_blips']:AddBlipInfoText(BankLocations.blip, Translation[Config.Locale]['disc_blip'])
		end
	end
end)
```

*Thats it!*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://maxifaxipaxi-1.gitbook.io/mfpscripts-fivem-discontinued/scripts/mfp_advancedblips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
