[+] Add Driving License to Interaction Menu and as 'Object' to show other Players via the Interaction menu

This commit is contained in:
Lukas Moungos
2019-11-02 18:36:17 +01:00
parent e3c3949f1b
commit c46c778a47
14 changed files with 296 additions and 26 deletions

View File

@@ -0,0 +1,35 @@
html, body {
overflow: hidden;
}
#schein {
overflow: hidden;
position: absolute;
right: 0px;
bottom: 0px;
animation: 1s ease-out 0s 1 slideInFromLeft;
}
#erworbene {
overflow: hidden;
Position: absolute;
right: 15%;
top: 46%;
}
#name {
overflow: hidden;
Position: absolute;
left: 40%;
top: 24.4%;
}
@keyframes slideInFromLeft {
0% {
transform: translateY(100%);
}
100% {
transform: translateX(0);
}
}

View File

@@ -0,0 +1,26 @@
<html>
<head>
<link rel="stylesheet" href="package://assets/css/licenses/schein.css">
</head>
<body scroll="no">
<div id="schein">
<img src="package://assets/img/licenses/schein.png">
<div id="name">
</div>
<div id="erworbene">
<p id="0"></p>
<p id="1"></p>
<p id="2"></p>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="package://assets/js/licenses/scheine.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

View File

@@ -0,0 +1,34 @@

$(document).ready(function () {
mp.trigger('CEF:LicenseLoaded');
});
function add_licenses(info) {
infoArr = JSON.parse(info);
console.log(infoArr);
for (var i = 0; i < infoArr.length; i++) {
var Schein = "";
if (infoArr[i] == true) {
if (i == 0) {
Schein = "Auto";
} else if (i == 1) {
Schein = "Motorrad";
} else if (i == 2) {
Schein = "Flugzeug";
}
}
$('#'+i).append(""+Schein);
}
}
function add_licensesholder(info) {
name = JSON.parse(info);
$('#name').append("<p>" + name + "</p>");
}