Sign in to follow this  
Jengas

Triggering markers

Recommended Posts

Hello! I am developing a server and I have a problem. 
I have made a marker (pickup) 

mp.markers.new(29, new mp.Vector3(248.28216552734375, 222.77394104003906, 106), 1, {
    direction: new mp.Vector3(247.1170196533203, 222.15045166015625, 106.28682708740234),
    rotation: new mp.Vector3(0, 0, 0),
    color: [46, 204, 113, 255],
    visible: true,
    dimension: 0
});

But then I wanted to trigger it when player stands on it. But I could not find this event to make a function. Is there a way to make a function when player stands on marker?

Edited by Jengas

Share this post


Link to post
Share on other sites

First you create a Colshape:

Zitat

var circlesize = 1.5; // <-- For the Cicle size of Colshape or set direct in mp.Colshape
 const shape = mp.colshapes.newSphere(248.28216552734375, 222.77394104003906, 106, circlesize);

 

After this set a Event:

Zitat

            mp.events.add({
                "playerEnterColshape" : (player, shape) => {
                    if ( player.vehicle){  return; }
                    console.log("Now I do anything");
                },
            })

Here with "player.vehicle" (Request player is in a car)

Share this post


Link to post
Share on other sites

"request player is in a car" is simply wrong.

If player would be in a car, nothing would be triggered. Also you can write

 if ( player.vehicle) return;

instead of

 if ( player.vehicle){  return; }

 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.