forked from Simnation/Main
ed
This commit is contained in:
parent
48844d7321
commit
769454360e
72 changed files with 734 additions and 0 deletions
BIN
resources/[tools]/cfx_nteam_train_scenario/.fxap
Normal file
BIN
resources/[tools]/cfx_nteam_train_scenario/.fxap
Normal file
Binary file not shown.
BIN
resources/[tools]/cfx_nteam_train_scenario/client.lua
Normal file
BIN
resources/[tools]/cfx_nteam_train_scenario/client.lua
Normal file
Binary file not shown.
90
resources/[tools]/cfx_nteam_train_scenario/config.lua
Normal file
90
resources/[tools]/cfx_nteam_train_scenario/config.lua
Normal file
|
@ -0,0 +1,90 @@
|
|||
Config = {}
|
||||
|
||||
Config.BlackBarSize = 0.20
|
||||
|
||||
HideHud = function(status)
|
||||
|
||||
end
|
||||
|
||||
--===================================================================
|
||||
-- SCENARIOS
|
||||
--===================================================================
|
||||
|
||||
-- You can add as many scenarios you want ( like before going to jail, or to transfer player from city to paleto or sandy , or any other idea you have like scenario for something )
|
||||
|
||||
Config.Scenarios = {
|
||||
['Welcome'] = { -- this name must stay Welcome if you are using it for PostCharacterCreator
|
||||
StartWalkLocation = vector4(2628.1289, 2936.3772, 40.4228, 57.3484), -- location where player scenario starts
|
||||
StopWalkingLocation = vector4(2623.7268, 2938.6338, 40.4228, 64.0300), -- walking from coords to coords must be straight line
|
||||
-- Location where train will be spawned
|
||||
spawnLocation = vector4(2614.9763, 2944.1470, 40.1375, 140.1980),
|
||||
-- Final Destination where train will stop and player gets out
|
||||
targetLocation = vector3(324.7359, -1796.8044, 28.1226),
|
||||
TrainModel = 24,
|
||||
TrainDirection = false, -- its true/false
|
||||
PlayerInCarriage = true,
|
||||
DriverModel = 'u_m_m_edtoh',
|
||||
-- location where player will be teleported after train stopes at station
|
||||
StationCoords = vector4(313.8152, -1784.0806, 28.1811, 236.6900),
|
||||
PostScenario = function()
|
||||
-- this is client side function
|
||||
-- You can trigger any client or server event here / or any client export
|
||||
end,
|
||||
},
|
||||
|
||||
-- this is our example for video you can edit it or use it ( here we replaced train with another model but you can use any model you want )
|
||||
['Jail'] = {
|
||||
StartWalkLocation = vector4(184.5892, -1908.8032, 22.8594, 227.5445), -- location where player scenario starts
|
||||
StopWalkingLocation = vector4(206.6665, -1933.1744, 22.3089, 216.1803), -- walking from coords to coords must be straight line
|
||||
-- Location where train will be spawned
|
||||
spawnLocation = vector4(212.1824, -1931.2069, 22.7389, 318.9960),
|
||||
-- Final Destination where train will stop and player gets out
|
||||
targetLocation = vector3(1965.6018, 2419.7219, 60.2874),
|
||||
TrainModel = 20,
|
||||
TrainDirection = true, -- its true/false
|
||||
PlayerInCarriage = true,
|
||||
DriverModel = 'u_m_m_edtoh',
|
||||
-- location where player will be teleported after train stopes at station
|
||||
StationCoords = vector4(1851.5878, 2585.7178, 45.6719, 85.5455),
|
||||
PostScenario = function()
|
||||
-- this is client side function
|
||||
-- You can trigger any client or server event here / or any client export
|
||||
-- for example here add your jail logic ( to send player to jail )
|
||||
end,
|
||||
},
|
||||
|
||||
['Paleto'] = {
|
||||
StartWalkLocation = vector4(-459.9373, 5368.5127, 81.2990, 251.0909), -- location where player scenario starts
|
||||
StopWalkingLocation = vector4(-453.2338, 5366.6680, 81.2989, 253.9655), -- walking from coords to coords must be straight line
|
||||
-- Location where train will be spawned
|
||||
spawnLocation = vector4(-447.7654, 5358.0933, 81.9381, 181.3557),
|
||||
-- Final Destination where train will stop and player gets out
|
||||
targetLocation = vector3(1810.5146, 3510.3872, 38.7271),
|
||||
TrainModel = 24,
|
||||
TrainDirection = false, -- its true/false
|
||||
PlayerInCarriage = true,
|
||||
DriverModel = 'u_m_m_edtoh',
|
||||
-- location where player will be teleported after train stopes at station
|
||||
StationCoords = vector4(1825.2296, 3508.4880, 38.3468, 28.0931),
|
||||
PostScenario = function()
|
||||
-- this is client side function
|
||||
-- You can trigger any client or server event here / or any client export
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
--=======================================================================
|
||||
-- HOW TO USE THIS RESOUCE
|
||||
--=======================================================================
|
||||
|
||||
--[[
|
||||
If you want to use This Resource Scenarios you can call it from Client using event :
|
||||
|
||||
--@ type is 'Welcome','Jail' or any other scenario you created
|
||||
TriggerEvent('train:startscenario',type)
|
||||
|
||||
If you want to use it from server call it like this :
|
||||
|
||||
TriggerClientEvent('train:startscenario', source, type)
|
||||
]]
|
32
resources/[tools]/cfx_nteam_train_scenario/fxmanifest.lua
Normal file
32
resources/[tools]/cfx_nteam_train_scenario/fxmanifest.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
fx_version 'cerulean'
|
||||
|
||||
author "NTeam Development"
|
||||
version '1.0.0'
|
||||
description 'NTeam Train Scenario'
|
||||
|
||||
games { 'gta5' }
|
||||
lua54 'yes'
|
||||
|
||||
ui_page 'html/index.html'
|
||||
|
||||
files {
|
||||
'html/index.html',
|
||||
'html/sounds/*.mp3',
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
'config.lua',
|
||||
}
|
||||
|
||||
client_scripts {
|
||||
'client.lua',
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'server.lua',
|
||||
}
|
||||
|
||||
escrow_ignore {
|
||||
'config.lua',
|
||||
}
|
||||
dependency '/assetpacks'
|
97
resources/[tools]/cfx_nteam_train_scenario/html/index.html
Normal file
97
resources/[tools]/cfx_nteam_train_scenario/html/index.html
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>NTeam Train Scenario</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.button-container, .welcome-container {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
.button-container {
|
||||
bottom: 50px;
|
||||
}
|
||||
.welcome-container {
|
||||
top: 30%;
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
font-size: 50px;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
opacity: 1;
|
||||
transition: opacity 1s ease-out; /* Fade-out transition */
|
||||
}
|
||||
.welcome-container.fade-out {
|
||||
opacity: 0;
|
||||
}
|
||||
.welcome-container div {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.welcome-container span {
|
||||
color: turquoise;
|
||||
}
|
||||
.button-container span {
|
||||
color: red;
|
||||
}
|
||||
.logo {
|
||||
display: block;
|
||||
margin: 10px auto;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.addEventListener('message', function(event) {
|
||||
if (event.data.action === 'showUI') {
|
||||
document.querySelector('.button-container').style.display = 'block';
|
||||
} else if (event.data.action === 'hideUI') {
|
||||
document.querySelector('.button-container').style.display = 'none';
|
||||
} else if (event.data.action === 'showWelcome') {
|
||||
document.querySelector('.welcome-container').style.display = 'flex';
|
||||
document.querySelector('.welcome-container').classList.remove('fade-out');
|
||||
playWelcomeSound();
|
||||
} else if (event.data.action === 'hideWelcome') {
|
||||
const welcomeContainer = document.querySelector('.welcome-container');
|
||||
welcomeContainer.classList.add('fade-out');
|
||||
setTimeout(function() {
|
||||
welcomeContainer.style.display = 'none';
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function playWelcomeSound() {
|
||||
let audio = new Audio(`nui://${GetParentResourceName()}/html/sounds/welcome.mp3`); // Replace with your sound file
|
||||
audio.play();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="button-container">PRESS<span> SPACE</span> TO CHANGE CAMERA</div>
|
||||
<div class="welcome-container">
|
||||
<!-- IF YOU WANT TO USE MESSAGE UNCOMMENT THIS LINE UNDER THIS COMMENT AND IF YOU WANT TO USE JUST LOGO UPLOAD IT AND EDIT LINK -->
|
||||
<!-- <div>WELCOME TO <span>NTEAM</span> SERVER</div> -->
|
||||
<img class="logo" src="https://iili.io/2txUqIR.png" alt="">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
BIN
resources/[tools]/cfx_nteam_train_scenario/server.lua
Normal file
BIN
resources/[tools]/cfx_nteam_train_scenario/server.lua
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue