Sign in to follow this  
justlead

Massive of colshapes

Recommended Posts

I am doing like this. Why it isnt working?

var LapColshapes = []

let StartTestingLapHandler = () => {
    for(var i = 0; i < CheckPointsVectors.length; i++){
        var x = CheckPointsVectors[i].x;
        var y = CheckPointsVectors[i].y;
        var z = CheckPointsVectors[i].z;
        let colshape = mp.colshapes.newRectangle(x,y,10,10);
        LapColshapes.push(colshape);
        for(var j = 0; j < arrRacers.length;j++){
            arrRacers[j].call("GenerateRaceMarker",[x + "", y + "",z + ""]);
        }
    }
    console.log(LapColshapes); // Its in massive. Its OK
};

mp.events.add("StartTestingLap",StartTestingLapHandler);

let PlayerEnterColshapeHandler = (player, shape) => {
    //Not working
    console.log("enter");
    for(var i = 0; i < LapColshapes.length; i++){

        if(shape == LapColshapes[i]) player.call("DeleteRaceMarker",[i]);
    }
};

mp.events.add("playerEnterColshape",PlayerEnterColshapeHandler);

 

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.