1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-04 10:19:24 +02:00
parent 2f2d0b1103
commit 7fd278affb
15 changed files with 22 additions and 4055 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -8,6 +8,15 @@ config.metadata = {
{ metadata = "nationality", value = "Nationality:" },
{ metadata = "quality", value = "Quality:" },
},
greencard = {
{ metadata = "citizenid", value = "CSN:" },
{ metadata = "firstname", value = "First Name:" },
{ metadata = "lastname", value = "Last Name:" },
{ metadata = "birthdate", value = "Birth Date:" },
{ metadata = "gender", value = "Gender:" },
{ metadata = "nationality", value = "Nationality:" },
{ metadata = "quality", value = "Quality:" },
},
driver_license = {
{ metadata = "firstname", value = "First Name:" },
{ metadata = "lastname", value = "Last Name:" },

View file

@ -10915,5 +10915,18 @@ itemsData = {
image = 'weaponlicense.png',
name = 'weaponlicense',
},
greencard= {
shouldClose = true,
type = 'item',
description = 'Deine Zeitlich begrenzte Genehmigung für deine LS aufenthalt.',
weight = 10,
label = 'Greencard',
unique = true,
useable = true,
image = 'greencard.png',
name = 'greencard',
},
}

File diff suppressed because it is too large Load diff

View file

@ -1,317 +0,0 @@
Config = {}
-- Allgemeine Einstellungen
Config.Debug = true
Config.UseBackgroundImages = true
Config.MaxLicenseAge = 365 -- Tage bis Ablauf
Config.RenewalDays = 30 -- Tage vor Ablauf für Verlängerung
-- Berechtigte Jobs
Config.AuthorizedJobs = {
['police'] = true,
['sheriff'] = true,
['government'] = true,
['judge'] = true,
['lawyer'] = true,
['ambulance'] = true, -- Für medizinische Lizenzen
['mechanic'] = true -- Für Fahrzeug-Lizenzen
}
-- Jobs that can reactivate specific license types
Config.ReactivationPermissions = {
['police'] = {'weapon_license', 'drivers_license'},
['admin'] = {'id_card', 'passport', 'business_license'},
['ambulance'] = {'medical_license'},
['driving_school'] = {'drivers_license'},
['harbor'] = {'boat_license'},
['airport'] = {'pilot_license'}
}
-- Lizenz-Typen
Config.LicenseTypes = {
['id_card'] = {
label = 'Personalausweis',
icon = 'fas fa-id-card',
color = '#667eea',
price = 50,
required_items = {},
can_expire = true,
validity_days = 3650, -- 10 Jahre
required_job = nil,
description = 'Offizieller Personalausweis'
},
['drivers_license'] = {
label = 'Führerschein',
icon = 'fas fa-car',
color = '#f093fb',
price = 500,
required_items = {'driving_test_certificate'},
can_expire = true,
validity_days = 5475, -- 15 Jahre
required_job = 'driving_school',
description = 'Berechtigung zum Führen von Kraftfahrzeugen',
classes = {
'A', 'A1', 'A2', 'B', 'BE', 'C', 'CE', 'D', 'DE'
}
},
['weapon_license'] = {
label = 'Waffenschein',
icon = 'fas fa-crosshairs',
color = '#4facfe',
price = 2500,
required_items = {'weapon_course_certificate', 'psychological_evaluation'},
can_expire = true,
validity_days = 1095, -- 3 Jahre
required_job = 'police',
description = 'Berechtigung zum Führen von Schusswaffen',
restrictions = {
'Nur für registrierte Waffen',
'Regelmäßige Überprüfung erforderlich',
'Nicht übertragbar'
}
},
['passport'] = {
label = 'Reisepass',
icon = 'fas fa-passport',
color = '#43e97b',
price = 150,
required_items = {'birth_certificate', 'id_card'},
can_expire = true,
validity_days = 3650, -- 10 Jahre
required_job = 'government',
description = 'Internationales Reisedokument'
},
['business_license'] = {
label = 'Gewerbeschein',
icon = 'fas fa-briefcase',
color = '#fa709a',
price = 1000,
required_items = {'business_plan', 'tax_certificate'},
can_expire = true,
validity_days = 1825, -- 5 Jahre
required_job = 'government',
description = 'Berechtigung zur Ausübung eines Gewerbes'
},
['pilot_license'] = {
label = 'Pilotenlizenz',
icon = 'fas fa-plane',
color = '#667eea',
price = 5000,
required_items = {'flight_hours_log', 'medical_certificate'},
can_expire = true,
validity_days = 730, -- 2 Jahre
required_job = 'airport',
description = 'Berechtigung zum Führen von Luftfahrzeugen'
},
['boat_license'] = {
label = 'Bootsführerschein',
icon = 'fas fa-ship',
color = '#00f2fe',
price = 800,
required_items = {'boat_course_certificate'},
can_expire = true,
validity_days = 1825, -- 5 Jahre
required_job = 'harbor',
description = 'Berechtigung zum Führen von Wasserfahrzeugen'
},
['medical_license'] = {
label = 'Approbation',
icon = 'fas fa-user-md',
color = '#ff6b6b',
price = 0, -- Kostenlos für Ärzte
required_items = {'medical_degree', 'medical_exam'},
can_expire = false,
validity_days = nil,
required_job = 'ambulance',
description = 'Berechtigung zur Ausübung der Heilkunde'
},
['hunting_license'] = {
label = 'Jagdschein',
icon = 'fas fa-crosshairs',
color = '#8b5a3c',
price = 300,
required_items = {'hunting_course_certificate'},
can_expire = true,
validity_days = 1095, -- 3 Jahre
required_job = 'police',
description = 'Berechtigung zur Ausübung der Jagd'
},
['fishing_license'] = {
label = 'Angelschein',
icon = 'fas fa-fish',
color = '#4ecdc4',
price = 50,
required_items = {},
can_expire = true,
validity_days = 365, -- 1 Jahr
required_job = 'police',
description = 'Berechtigung zum Angeln in öffentlichen Gewässern'
}
}
-- Standorte für Lizenz-Ausgabe
Config.LicenseLocations = {
['city_hall'] = {
label = 'Rathaus',
coords = vector3(-544.85, -204.13, 38.22),
blip = {
sprite = 419,
color = 2,
scale = 0.8
},
available_licenses = {
'id_card', 'passport', 'business_license'
},
ped = {
model = 'a_m_m_business_01',
coords = vector4(-544.9543, -204.8450, 37.2151, 219.1676)
}
},
['driving_school'] = {
label = 'Fahrschule',
coords = vector3(-829.22, -1209.58, 7.33),
blip = {
sprite = 225,
color = 46,
scale = 0.8
},
available_licenses = {
'drivers_license'
},
ped = {
model = 'a_m_y_business_02',
coords = vector4(-829.22, -1209.58, 6.33, 90.0)
}
},
['police_station'] = {
label = 'Polizeiwache',
coords = vector3(441.07, -979.76, 30.69),
blip = {
sprite = 60,
color = 29,
scale = 0.8
},
available_licenses = {
'weapon_license'
},
ped = {
model = 's_m_y_cop_01',
coords = vector4(441.07, -979.76, 29.69, 270.0)
}
},
['hospital'] = {
label = 'Krankenhaus',
coords = vector3(307.7, -1433.4, 29.9),
blip = {
sprite = 61,
color = 1,
scale = 0.8
},
available_licenses = {
'medical_license'
},
ped = {
model = 's_m_m_doctor_01',
coords = vector4(307.7, -1433.4, 28.9, 180.0)
}
}
}
-- Kommandos
Config.Commands = {
['license'] = {
name = 'lizenz',
help = 'Lizenz-System öffnen',
restricted = true -- Nur für berechtigte Jobs
},
['mylicense'] = {
name = 'meinelizenz',
help = 'Eigene Lizenzen anzeigen',
restricted = false -- Für alle Spieler
},
['givelicense'] = {
name = 'givelicense',
help = 'Lizenz an Spieler vergeben',
restricted = true,
admin_only = true
},
['revokelicense'] = {
name = 'revokelicense',
help = 'Lizenz entziehen',
restricted = true,
admin_only = false
}
}
-- Keybinds
Config.Keybinds = {
['open_license_menu'] = {
key = 'F6',
command = 'lizenz',
description = 'Lizenz-System öffnen'
},
['show_my_licenses'] = {
key = 'F7',
command = 'meinelizenz',
description = 'Meine Lizenzen anzeigen'
}
}
-- Benachrichtigungen
Config.Notifications = {
['no_permission'] = {
message = 'Du hast keine Berechtigung!',
type = 'error'
},
['no_players_nearby'] = {
message = 'Keine Spieler in der Nähe!',
type = 'error'
},
['license_not_found'] = {
message = 'Keine Lizenz gefunden!',
type = 'error'
},
['license_expired'] = {
message = 'Diese Lizenz ist abgelaufen!',
type = 'warning'
},
['license_expires_soon'] = {
message = 'Diese Lizenz läuft bald ab!',
type = 'warning'
},
['license_granted'] = {
message = 'Lizenz erfolgreich ausgestellt!',
type = 'success'
},
['license_revoked'] = {
message = 'Lizenz wurde entzogen!',
type = 'info'
},
['photo_saved'] = {
message = 'Foto gespeichert!',
type = 'success'
},
['insufficient_funds'] = {
message = 'Nicht genügend Geld!',
type = 'error'
},
['missing_items'] = {
message = 'Benötigte Gegenstände fehlen!',
type = 'error'
}
}
-- Sounds
Config.Sounds = {
['card_flip'] = 'sounds/card_flip.mp3',
['camera_shutter'] = 'sounds/camera_shutter.mp3',
['notification'] = 'sounds/notification.mp3'
}
-- Datenbank-Einstellungen
Config.Database = {
['table_name'] = 'player_licenses',
['auto_cleanup'] = true, -- Alte Lizenzen automatisch löschen
['cleanup_days'] = 365 -- Nach wie vielen Tagen löschen
}

View file

@ -1,35 +0,0 @@
fx_version 'cerulean'
game 'gta5'
author 'YourName'
description 'License System for QBCore'
version '1.0.0'
shared_scripts {
'@ox_lib/init.lua',
'config.lua'
}
client_scripts {
'client/main.lua'
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/main.lua'
}
ui_page 'html/index.html'
files {
'html/index.html',
'html/style.css',
'html/script.js',
'html/images/*.png'
}
dependencies {
'qb-core',
'ox_lib',
'oxmysql'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,274 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>License System</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<!-- Hauptcontainer für Lizenz-Anzeige -->
<div id="license-container" class="hidden">
<div class="license-overlay" onclick="closeLicense()"></div>
<div class="license-card" id="license-card">
<!-- Sicherheitselemente -->
<div class="security-strip"></div>
<div class="hologram"></div>
<div class="microtext">SECURE DOCUMENT • OFFICIAL USE ONLY • GOVERNMENT ISSUED</div>
<!-- Header der Lizenz -->
<div class="license-header">
<div class="header-left">
<div class="license-title" id="license-title">Personalausweis</div>
<div class="license-subtitle">Bundesrepublik Deutschland</div>
</div>
<div class="header-right">
<div class="license-logo">
<i class="license-icon" id="license-icon"></i>
</div>
<div class="government-seal">
<i class="fas fa-certificate"></i>
</div>
</div>
</div>
<!-- Hauptinhalt der Lizenz -->
<div class="license-content">
<!-- Foto-Bereich -->
<div class="license-photo-section">
<div class="license-photo" id="license-photo">
<img id="player-photo" class="hidden" alt="Spieler Foto">
<div id="photo-placeholder" class="photo-placeholder">
<i class="fas fa-user"></i>
</div>
</div>
<div class="photo-frame"></div>
</div>
<!-- Informations-Bereich -->
<div class="license-info">
<div class="info-section personal-info">
<h3 class="section-title">Persönliche Daten</h3>
<div class="info-row">
<span class="label">
<i class="fas fa-user"></i>
Name:
</span>
<span class="value" id="license-name">Max Mustermann</span>
</div>
<div class="info-row">
<span class="label">
<i class="fas fa-birthday-cake"></i>
Geburtsdatum:
</span>
<span class="value" id="license-birthday">01.01.1990</span>
</div>
<div class="info-row">
<span class="label">
<i class="fas fa-venus-mars"></i>
Geschlecht:
</span>
<span class="value" id="license-gender">Männlich</span>
</div>
</div>
<div class="info-section document-info">
<h3 class="section-title">Dokument-Informationen</h3>
<div class="info-row">
<span class="label">
<i class="fas fa-calendar-plus"></i>
Ausgestellt:
</span>
<span class="value" id="license-issue">01.01.2024</span>
</div>
<div class="info-row">
<span class="label">
<i class="fas fa-calendar-times"></i>
Gültig bis:
</span>
<span class="value" id="license-expire">01.01.2034</span>
</div>
<div class="info-row">
<span class="label">
<i class="fas fa-hashtag"></i>
Dokument-ID:
</span>
<span class="value" id="license-id">#000001</span>
</div>
<div class="info-row" id="license-classes-row">
<span class="label">
<i class="fas fa-list"></i>
Klassen:
</span>
<span class="value" id="license-classes">A, B, C</span>
</div>
<div class="info-row">
<span class="label">
<i class="fas fa-user-tie"></i>
Ausgestellt von:
</span>
<span class="value" id="license-issuer">Behörde</span>
</div>
</div>
</div>
</div>
<!-- Footer der Lizenz -->
<div class="license-footer">
<div class="footer-left">
<div class="license-status" id="license-status">
<i class="status-icon"></i>
<span class="status-text">Gültig</span>
</div>
<div class="validity-indicator" id="validity-indicator">
<div class="validity-bar">
<div class="validity-fill" id="validity-fill"></div>
</div>
<span class="validity-text" id="validity-text">Noch 365 Tage gültig</span>
</div>
</div>
<div class="footer-center">
<div class="qr-code" id="qr-code">
<div class="qr-pattern">
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
<div class="qr-dot"></div>
</div>
<span class="qr-label">QR</span>
</div>
</div>
<div class="footer-right">
<button class="action-btn view-btn" onclick="flipCard()" title="Rückseite anzeigen">
<i class="fas fa-sync-alt"></i>
<span>Drehen</span>
</button>
<button class="action-btn close-btn" onclick="closeLicense()" title="Schließen">
<i class="fas fa-times"></i>
<span>Schließen</span>
</button>
</div>
</div>
<!-- Rückseite der Lizenz (für Führerschein-Klassen etc.) -->
<div class="license-back hidden" id="license-back">
<div class="back-header">
<h3>Zusätzliche Informationen</h3>
</div>
<div class="back-content">
<div class="classes-grid" id="classes-grid">
<!-- Wird dynamisch befüllt -->
</div>
<div class="restrictions" id="restrictions">
<h4>Beschränkungen:</h4>
<ul id="restrictions-list">
<!-- Wird dynamisch befüllt -->
</ul>
</div>
<div class="notes" id="notes">
<h4>Bemerkungen:</h4>
<p id="notes-text">Keine besonderen Bemerkungen</p>
</div>
</div>
<div class="back-footer">
<button class="action-btn" onclick="flipCard()">
<i class="fas fa-arrow-left"></i>
Zurück
</button>
</div>
</div>
</div>
</div>
<!-- Kamera-Interface für Foto-Aufnahme -->
<div id="camera-container" class="hidden">
<div class="camera-overlay" onclick="closeCamera()"></div>
<div class="camera-interface">
<div class="camera-header">
<h3>Foto für Lizenz aufnehmen</h3>
<button class="camera-close" onclick="closeCamera()">
<i class="fas fa-times"></i>
</button>
</div>
<div class="camera-content">
<div class="camera-preview">
<video id="camera-video" autoplay playsinline></video>
<canvas id="camera-canvas" class="hidden"></canvas>
<div class="camera-overlay-guide">
<div class="face-guide">
<div class="guide-circle"></div>
<p>Gesicht hier positionieren</p>
</div>
</div>
</div>
<div class="camera-controls">
<button class="camera-btn capture-btn" onclick="takePhoto()">
<i class="fas fa-camera"></i>
Foto aufnehmen
</button>
<button class="camera-btn cancel-btn" onclick="closeCamera()">
<i class="fas fa-ban"></i>
Abbrechen
</button>
</div>
</div>
</div>
</div>
<!-- Loading-Overlay -->
<div id="loading-overlay" class="hidden">
<div class="loading-spinner">
<div class="spinner"></div>
<p>Lizenz wird geladen...</p>
</div>
</div>
<!-- Notification-System -->
<div id="notification-container">
<!-- Notifications werden hier dynamisch eingefügt -->
</div>
<!-- Audio für Sound-Effekte -->
<audio id="card-flip-sound" preload="auto">
<source src="sounds/card_flip.mp3" type="audio/mpeg">
</audio>
<audio id="camera-shutter-sound" preload="auto">
<source src="sounds/camera_shutter.mp3" type="audio/mpeg">
</audio>
<!-- JavaScript -->
<script src="script.js"></script>
</body>
</html>

View file

@ -1,341 +0,0 @@
let currentLicense = null;
let isCardFlipped = false;
let cameraStream = null;
// Event Listener für Nachrichten von FiveM
window.addEventListener('message', function(event) {
const data = event.data;
switch(data.action) {
case 'showLicense':
showLicense(data.data);
break;
case 'hideLicense':
closeLicense();
break;
case 'openCamera':
openCamera();
break;
}
});
// In der showLicense Funktion in script.js
function showLicense(data) {
currentLicense = data;
const container = document.getElementById('license-container');
const card = document.getElementById('license-card');
// Loading anzeigen
showLoading();
setTimeout(() => {
// Lizenztyp-spezifische Klasse hinzufügen
card.className = 'license-card ' + data.license.license_type;
// Header befüllen
document.getElementById('license-title').textContent = data.config.label;
document.getElementById('license-icon').className = 'license-icon ' + data.config.icon;
// Persönliche Daten
document.getElementById('license-name').textContent = data.license.name || 'N/A';
document.getElementById('license-birthday').textContent = formatDate(data.license.birthday) || 'N/A';
document.getElementById('license-gender').textContent = formatGender(data.license.gender) || 'N/A';
// Dokument-Informationen
document.getElementById('license-issue').textContent = formatDate(data.license.issue_date) || 'N/A';
document.getElementById('license-expire').textContent = formatDate(data.license.expire_date) || 'N/A';
document.getElementById('license-id').textContent = '#' + (data.license.id || '000000').toString().padStart(6, '0');
document.getElementById('license-issuer').textContent = data.license.issued_by_name || 'Behörde';
// Foto anzeigen
displayPlayerPhoto(data.license);
// Klassen anzeigen (nur bei Führerschein)
displayLicenseClasses(data.license);
// Status und Gültigkeit
displayLicenseStatus(data.license);
displayValidityIndicator(data.license);
// Rückseite vorbereiten
prepareBackSide(data.license);
// Container anzeigen
hideLoading();
container.classList.remove('hidden');
// Sound-Effekt
playSound('card-flip-sound');
// Notification
showNotification('Lizenz geladen', 'success');
}, 500);
}
// Erweitere die prepareBackSide Funktion um Bemerkungen anzuzeigen
function prepareBackSide(license) {
const classesGrid = document.getElementById('classes-grid');
const restrictionsList = document.getElementById('restrictions-list');
const notesText = document.getElementById('notes-text');
// Klassen-Grid für Führerschein
if (license.license_type === 'drivers_license' && license.classes) {
try {
const classes = Array.isArray(license.classes) ? license.classes : JSON.parse(license.classes);
classesGrid.innerHTML = '';
const classDescriptions = {
'A': 'Motorräder',
'A1': 'Leichte Motorräder',
'A2': 'Mittlere Motorräder',
'B': 'PKW',
'BE': 'PKW mit Anhänger',
'C': 'LKW',
'CE': 'LKW mit Anhänger',
'D': 'Bus',
'DE': 'Bus mit Anhänger'
};
if (classes && classes.length > 0) {
classes.forEach(cls => {
const classItem = document.createElement('div');
classItem.className = 'class-item';
classItem.innerHTML = `
<div class="class-letter">${cls}</div>
<div class="class-description">${classDescriptions[cls] || 'Unbekannt'}</div>
`;
classesGrid.appendChild(classItem);
});
} else {
classesGrid.innerHTML = '<p>Keine Klassen verfügbar</p>';
}
} catch (e) {
classesGrid.innerHTML = '<p>Keine Klassen verfügbar</p>';
}
} else {
classesGrid.innerHTML = '<p>Nicht zutreffend</p>';
}
// Beschränkungen (Beispiel)
restrictionsList.innerHTML = '<li>Keine besonderen Beschränkungen</li>';
// Bemerkungen
notesText.textContent = license.notes || 'Keine besonderen Bemerkungen';
}
// Karte drehen
function flipCard() {
const frontSide = document.querySelector('.license-content, .license-footer');
const backSide = document.getElementById('license-back');
isCardFlipped = !isCardFlipped;
if (isCardFlipped) {
// Zur Rückseite
document.querySelector('.license-content').classList.add('hidden');
document.querySelector('.license-footer').classList.add('hidden');
backSide.classList.remove('hidden');
} else {
// Zur Vorderseite
document.querySelector('.license-content').classList.remove('hidden');
document.querySelector('.license-footer').classList.remove('hidden');
backSide.classList.add('hidden');
}
playSound('card-flip-sound');
}
// Kamera öffnen
async function openCamera() {
const container = document.getElementById('camera-container');
const video = document.getElementById('camera-video');
try {
cameraStream = await navigator.mediaDevices.getUserMedia({
video: {
width: 640,
height: 480,
facingMode: 'user'
}
});
video.srcObject = cameraStream;
container.classList.remove('hidden');
showNotification('Kamera geöffnet', 'info');
} catch (err) {
console.error('Kamera-Zugriff fehlgeschlagen:', err);
showNotification('Kamera-Zugriff fehlgeschlagen', 'error');
}
}
// Foto aufnehmen
function takePhoto() {
const video = document.getElementById('camera-video');
const canvas = document.getElementById('camera-canvas');
const ctx = canvas.getContext('2d');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
ctx.drawImage(video, 0, 0);
const photoData = canvas.toDataURL('image/jpeg', 0.8);
// Sound-Effekt
playSound('camera-shutter-sound');
// An FiveM senden
fetch(`https://${GetParentResourceName()}/savePhoto`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
photo: photoData,
citizenid: currentLicense?.license?.citizenid
})
}).then(() => {
showNotification('Foto gespeichert', 'success');
closeCamera();
}).catch(err => {
console.error('Fehler beim Speichern:', err);
showNotification('Fehler beim Speichern', 'error');
});
}
// Kamera schließen
function closeCamera() {
const container = document.getElementById('camera-container');
if (cameraStream) {
cameraStream.getTracks().forEach(track => track.stop());
cameraStream = null;
}
container.classList.add('hidden');
}
// Lizenz schließen
function closeLicense() {
const container = document.getElementById('license-container');
container.classList.add('hidden');
// Karte zurücksetzen
isCardFlipped = false;
document.querySelector('.license-content').classList.remove('hidden');
document.querySelector('.license-footer').classList.remove('hidden');
document.getElementById('license-back').classList.add('hidden');
// Callback an FiveM
fetch(`https://${GetParentResourceName()}/closeLicense`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({})
}).catch(() => {}); // Fehler ignorieren
}
// Hilfsfunktionen
function formatGender(gender) {
const genderMap = {
'male': 'Männlich',
'female': 'Weiblich',
'other': 'Divers',
'm': 'Männlich',
'f': 'Weiblich'
};
return genderMap[gender?.toLowerCase()] || gender || 'Unbekannt';
}
function formatDate(dateString) {
if (!dateString) return null;
try {
const date = new Date(dateString);
return date.toLocaleDateString('de-DE');
} catch (e) {
return dateString;
}
}
function showLoading() {
document.getElementById('loading-overlay').classList.remove('hidden');
}
function hideLoading() {
document.getElementById('loading-overlay').classList.add('hidden');
}
function playSound(soundId) {
const audio = document.getElementById(soundId);
if (audio) {
audio.volume = 0.3;
audio.play().catch(() => {}); // Fehler ignorieren
}
}
function showNotification(message, type = 'info') {
const container = document.getElementById('notification-container');
const notification = document.createElement('div');
notification.className = `notification ${type}`;
notification.innerHTML = `
<div class="notification-content">
<i class="notification-icon fas ${getNotificationIcon(type)}"></i>
<span class="notification-text">${message}</span>
</div>
<button class="notification-close" onclick="this.parentElement.remove()">
<i class="fas fa-times"></i>
</button>
`;
container.appendChild(notification);
// Auto-remove nach 5 Sekunden
setTimeout(() => {
if (notification.parentElement) {
notification.remove();
}
}, 5000);
}
function getNotificationIcon(type) {
const icons = {
'success': 'fa-check-circle',
'error': 'fa-exclamation-circle',
'warning': 'fa-exclamation-triangle',
'info': 'fa-info-circle'
};
return icons[type] || icons.info;
}
// Event Listeners
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape') {
if (!document.getElementById('camera-container').classList.contains('hidden')) {
closeCamera();
} else if (!document.getElementById('license-container').classList.contains('hidden')) {
closeLicense();
}
}
if (event.key === 'f' || event.key === 'F') {
if (!document.getElementById('license-container').classList.contains('hidden')) {
flipCard();
}
}
});
// Klick außerhalb zum Schließen
document.getElementById('license-container').addEventListener('click', function(event) {
if (event.target.classList.contains('license-overlay')) {
closeLicense();
}
});
// Initialisierung
document.addEventListener('DOMContentLoaded', function() {
console.log('License System UI geladen');
});

View file

@ -1,368 +0,0 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background: transparent;
overflow: hidden;
}
.hidden {
display: none !important;
}
#license-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.license-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 15px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
width: 450px;
min-height: 300px;
color: white;
position: relative;
overflow: hidden;
}
.license-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
opacity: 0.3;
pointer-events: none;
}
.license-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}
.license-title {
font-size: 24px;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.license-logo {
font-size: 32px;
opacity: 0.8;
}
.license-content {
display: flex;
padding: 20px;
gap: 20px;
}
.license-photo {
width: 100px;
height: 120px;
background: rgba(255, 255, 255, 0.2);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid rgba(255, 255, 255, 0.3);
overflow: hidden;
position: relative;
}
#player-photo {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 6px;
}
#photo-placeholder {
font-size: 48px;
color: rgba(255, 255, 255, 0.7);
}
.hidden {
display: none !important;
}
.license-info {
flex: 1;
}
.info-row {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.info-row:last-child {
border-bottom: none;
margin-bottom: 0;
}
.label {
font-weight: bold;
opacity: 0.9;
min-width: 100px;
}
.value {
text-align: right;
opacity: 0.8;
}
.license-footer {
padding: 20px;
border-top: 2px solid rgba(255, 255, 255, 0.2);
display: flex;
justify-content: space-between;
align-items: center;
}
.license-status {
font-weight: bold;
padding: 5px 15px;
border-radius: 20px;
font-size: 14px;
}
.license-status.active {
background: rgba(76, 175, 80, 0.3);
color: #4CAF50;
border: 1px solid #4CAF50;
}
.license-status.inactive {
background: rgba(244, 67, 54, 0.3);
color: #F44336;
border: 1px solid #F44336;
}
.close-btn {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 10px 20px;
border-radius: 25px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
display: flex;
align-items: center;
gap: 8px;
}
.close-btn:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
/* Spezielle Styles für verschiedene Lizenztypen */
.license-card.id_card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.license-card.drivers_license {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.license-card.weapon_license {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.license-card.passport {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.license-card.business_license {
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
/* Responsive Design */
@media (max-width: 500px) {
.license-card {
width: 90vw;
margin: 20px;
}
.license-content {
flex-direction: column;
align-items: center;
}
.license-photo {
width: 80px;
height: 100px;
font-size: 36px;
}
}
/* Animation für das Erscheinen */
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-50px) scale(0.9);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.license-card {
animation: slideIn 0.3s ease-out;
}
/* Notification System */
#notification-container {
position: fixed;
top: 20px;
right: 20px;
z-index: 10000;
display: flex;
flex-direction: column;
gap: 10px;
}
.notification {
background: rgba(0, 0, 0, 0.9);
color: white;
padding: 15px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: space-between;
min-width: 300px;
animation: slideInRight 0.3s ease;
}
.notification.success { border-left: 4px solid #4CAF50; }
.notification.error { border-left: 4px solid #f44336; }
.notification.warning { border-left: 4px solid #ff9800; }
.notification.info { border-left: 4px solid #2196F3; }
.notification-content {
display: flex;
align-items: center;
gap: 10px;
}
.notification-close {
background: none;
border: none;
color: white;
cursor: pointer;
padding: 5px;
}
/* Loading Overlay */
#loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.loading-spinner {
text-align: center;
color: white;
}
.spinner {
width: 50px;
height: 50px;
border: 3px solid rgba(255, 255, 255, 0.3);
border-top: 3px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 20px;
}
/* Kamera Interface */
#camera-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.9);
display: flex;
align-items: center;
justify-content: center;
z-index: 9998;
}
.camera-interface {
background: white;
border-radius: 15px;
padding: 20px;
max-width: 600px;
width: 90%;
}
.camera-preview {
position: relative;
margin: 20px 0;
}
#camera-video {
width: 100%;
border-radius: 10px;
}
.face-guide {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
color: white;
}
.guide-circle {
width: 200px;
height: 200px;
border: 3px solid rgba(255, 255, 255, 0.8);
border-radius: 50%;
margin: 0 auto 10px;
}
/* Animationen */
@keyframes slideInRight {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

File diff suppressed because it is too large Load diff