Jump to content

Trying to add blips through an array.


Ajax_

Recommended Posts

Hello,

I am pretty new to RageMP development. So far it's looking great, nice work by the devs :)

I am stuck on a certain part for now though. I am trying to add blips on a map through an array. It is placing the blip, but only on one location, but that also not in either of the co-ordinates in the array.

let fuelCords = [
	"261.078, -1266.621, 28.407",
	"1180.527, -325.744, 68.437"
];

fuelCords.forEach(function(object, index) {
    mp.blips.new(72, new mp.Vector3(object), {
		name: 'Gas Station',
		color: 51,
		shortRange: true,
	});
});

Any help would be greatly appreciated.

Edited by Ajax_
Link to comment
Share on other sites

  • 2 years later...
let fuelCords = [
    {x: 261.078, y: -1266.621, z: 28.407},
    {x: 1180.527, y: -325.744, z: 68.437}
];
 
for (let i = 0; i < fuelCords.length; i++) {
    const element = fuelCords[i];
    mp.blips.new(72, new mp.Vector3(element.x, element.y, element.z), {
        name: 'Benzinlik',
        color: 51,
        shortRange: true,
    })
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...