Sign in to follow this  

Triggering markers

Recommended Posts

Hello! I am developing a server and I have a problem. 
I have made a marker (pickup), 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:


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:


                "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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.