2021-05-21 14:09:28 +02:00
|
|
|
#pragma once
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "gta/enums.hpp"
|
2021-05-21 14:09:28 +02:00
|
|
|
#include "natives.hpp"
|
|
|
|
#include "script.hpp"
|
|
|
|
|
|
|
|
namespace big::blip
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
inline bool get_blip_location(Vector3& location, int sprite, int color = -1)
|
2021-05-21 14:09:28 +02:00
|
|
|
{
|
|
|
|
Blip blip;
|
2023-03-01 21:27:15 +00:00
|
|
|
for (blip = HUD::GET_FIRST_BLIP_INFO_ID(sprite); HUD::DOES_BLIP_EXIST(blip) && color != -1 && HUD::GET_BLIP_COLOUR(blip) != color; blip = HUD::GET_NEXT_BLIP_INFO_ID(sprite))
|
|
|
|
;
|
2021-05-21 14:09:28 +02:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
if (!HUD::DOES_BLIP_EXIST(blip) || (color != -1 && HUD::GET_BLIP_COLOUR(blip) != color))
|
|
|
|
return false;
|
2021-05-21 14:09:28 +02:00
|
|
|
|
|
|
|
location = HUD::GET_BLIP_COORDS(blip);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2022-07-31 00:53:08 +08:00
|
|
|
|
|
|
|
inline bool get_objective_location(Vector3& location)
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
if (get_blip_location(location, (int)BlipIcons::Circle, (int)BlipColors::YellowMission))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::Circle, (int)BlipColors::YellowMission2))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::Circle, (int)BlipColors::Mission))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::RaceFinish, (int)BlipColors::None))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::Circle, (int)BlipColors::Green))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::Circle, (int)BlipColors::Blue))
|
|
|
|
return true;
|
|
|
|
if (get_blip_location(location, (int)BlipIcons::CrateDrop))
|
|
|
|
return true;
|
2022-07-31 00:53:08 +08:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
static const int blips[] = {1, 57, 128, 129, 130, 143, 144, 145, 146, 271, 286, 287, 288};
|
2022-07-31 00:53:08 +08:00
|
|
|
for (const auto& blip : blips)
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
if (get_blip_location(location, blip, 5))
|
|
|
|
return true;
|
2022-07-31 00:53:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2021-05-21 14:09:28 +02:00
|
|
|
}
|