Sign in to follow this  
FlatYakVolunteer

404 error: File not found

Recommended Posts

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%;
}

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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');
});

 

Share this post


Link to post
Share on other sites

dont know what you are trying to tell me but that's how it works. you need the full path from your client_packages

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.

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