Jump to content

Recommended Posts

Posted (edited)

Hello! I'm creating a Business system using MySQL. I can load the business from MySQL and it automatically creates the Marker but not the Colshape. trying the code outside the event, the colshape is created.

JS/Serverside

var bMarkers;
var bShapes;

mp.events.add("CreateShops", (id, ex, ey, ez, type, dimension) => {
	bMarkers[id] = mp.markers.new(1, new mp.Vector3(ex, ey, ez), 0.5,
	{
		direction: 1,
		rotation: 0,
		color: [174, 219, 242, 150],
		visible: true,
		dimension: dimension
	});
	
	// THIS DONT WORK INSIDE THE EVENT
	bShapes[id] = mp.colshapes.newSphere(ex, ey, ez, 4);
});

// THIS WORKS OUTSIDE THE EVENT
mp.colshapes.newSphere(428.67, -800.08, 28.49, 4);

mp.events.add("playerExitColshape", (player, shape) => {
	player.outputChatBox("outside");
});

mp.events.add("playerEnterColshape", (player, shape) => {
    player.outputChatBox("inside");
});

 

SOLVED

 

Please close

Edited by hdrtop
Solved

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...