What wrong here?
void teleport_to_objective()
{
Vector3 coords;
Entity e;
Ped playerPed = PLAYER::PLAYER_PED_ID();
if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, FALSE))
e = PED::GET_VEHICLE_PED_IS_USING(playerPed);
else e = playerPed;
bool blipFound = false;
if (ENTITY::IS_ENTITY_A_VEHICLE(e)) RequestControlOfEnt(e);
for (int i = 0; i <= 1000; i++)
{
Blip_t* blip = Hooking::GetBlipList()->m_Blips[i];
if (blip)
{
if ((blip->dwColor == ColorYellowMission && blip->iIcon == SpriteStandard) || (blip->dwColor == ColorYellow && blip->iIcon == SpriteStandard) ||
(blip->dwColor == ColorWhite && blip->iIcon == SpriteRaceFinish) || (blip->dwColor == ColorGreen && blip->iIcon == SpriteStandard) || (blip->iIcon == SpriteCrateDrop)) {
coords = blip->coords;
blipFound = true;
break;
}
}
}
blipFound ? teleport_to_coords(e, coords) : notifyMap("~y~Objective not found!", 0);
}
void teleport_to_objective()
{
Vector3 coords;
Entity e;
Ped playerPed = PLAYER::PLAYER_PED_ID();
if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, FALSE))
e = PED::GET_VEHICLE_PED_IS_USING(playerPed);
else e = playerPed;
bool blipFound = false;
if (ENTITY::IS_ENTITY_A_VEHICLE(e)) RequestControlOfEnt(e);
for (int i = 0; i <= 1000; i++)
{
Blip_t* blip = Hooking::GetBlipList()->m_Blips[i];
if (blip)
{
if ((blip->dwColor == ColorYellowMission && blip->iIcon == SpriteStandard) || (blip->dwColor == ColorYellow && blip->iIcon == SpriteStandard) ||
(blip->dwColor == ColorWhite && blip->iIcon == SpriteRaceFinish) || (blip->dwColor == ColorGreen && blip->iIcon == SpriteStandard) || (blip->iIcon == SpriteCrateDrop)) {
coords = blip->coords;
blipFound = true;
break;
}
}
}
blipFound ? teleport_to_coords(e, coords) : notifyMap("~y~Objective not found!", 0);
}