Jump to content

Recommended Posts

Posted

Hi.  I understand that it says “File not found”, but I have been sitting for more than an hour trying to understand what is wrong, can anyone come across this?

Here is the code:
 

// This server-side
let colpickup = module.exports;

mp.markers.new(1, new mp.Vector3(2.9395463466644287, -400.83831787109375, 38), 1,
{
    direction: new mp.Vector3(2.9395463466644287, -400.83831787109375, 39.40178680419922),
    rotation: new mp.Vector3(0, 0, 0),
    color: [255, 255, 255, 255],
    visible: true,
    dimension: 0
});

colpickup.colShape = mp.colshapes.newRectangle(parseFloat(2.9395463466644287), parseFloat(-400.83831787109375), 2, 2);

mp.events.add('playerEnterColshape', (player, shape) => {
	if(colpickup.colShape == shape) {
		player.call('EnterColshape', ['1']);
		player.outputChatBox("shape!");
	}
});

// Here is client-side - bindkeys.js
let browser;

mp.gui.cursor.show(false, false);

mp.events.add('EnterColshape', (shape) => {
	switch(shape) {
		case '1': {
			browser = mp.browsers.new("package://offer.html");
			mp.gui.chat.push('successful');
			break;
		}
	}
});	

mp.events.add('playerExitColshape', (player, shape) => {
	mp.gui.chat.push('exit');
});

// This is HTML
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<link href="style.css" rel="stylesheet" type="text/css"/>
	</head>
	<body>
		<div id="text">
			Работа строителем<br/>
			Вы хотите устроиться?<br/>
			<hr/>
			<button type="Yes">Да</button>
			<button type="No">Нет</button>
		</div>
	</body>	
</html>

// This is CSS
#text {
	color: black;
	font-size: 20px;
	text-align: center;
	background-color: #FFFFFF;
	border: 2px solid #000000;
	border-radius: 15px;
	padding-top: 20px;
	padding-bottom: 20px;
	margin-top: 15%;
	margin-left: 40%;
	margin-right: 40%;
}

 

Posted

Yes,

this: 

browser = mp.browsers.new("package://offer.html");

Check path to your html file. This would mean the offer.html is in client_ressources folder directly without any subfolder.
Post a screenshot of your folder view

Posted (edited)
8 часов назад, Flow сказал:

Yes,

this: 


browser = mp.browsers.new("package://offer.html");

Check path to your html file. This would mean the offer.html is in client_ressources folder directly without any subfolder.
Post a screenshot of your folder view

UPD: I changed path to browser = mp.browsers.new("package://qwerty/offer.html");
And - nothing (
https://imgur.com/a/adGVead

Edited by FlatYakVolunteer
Posted
1 минуту назад, Flow сказал:

mp.browsers.new("package://builder/qwerty/offer.html");

bindkeys.js - this is main file
bindkeys.js located in folder "builder"

let browser;

mp.gui.cursor.show(false, false);

mp.events.add('EnterColshape', (shape) => {
	switch(shape) {
		case '1': {
			browser = mp.browsers.new("package://offer.html");
			mp.gui.chat.push('successful');
			break;
		}
	}
});	

mp.events.add('playerExitColshape', (player, shape) => {
	mp.gui.chat.push('exit');
});

 

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