Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Question JS + LUA help

donking011

Member
Joined
Sep 21, 2021
Messages
6
Reaction score
0
Points
156
Location
Budapest
Hi guys,

I need some help with JS and LUA..

I saw a video from YT how can i make a fivem mod from 0. I checked all of them but it doesn't work...here is the code, anyone pls help?

Code:
RegisterNetEvent('LS-Base:Char:setupCharacters')
AddEventHandler('LS-Base:Char:setupCharacters', function()
    LS.Functions.TriggerServerCallback('LS-Base:getChar', function(data) -- Gets all data from character
        SendNUIMessage({type = "setupCharacters", characters = data})
    end)
end)

And here is the main.js:


JavaScript:
window.addEventListener('message', function(event) {
        var data = event.data;

        if (data.type === "setupCharacters") {
            var characters = data.characters;
            if (characters !== null) {
                $.each(characters, function (index, char) {
                    $('[data-charid=' + char.cid + ']').html('');
                    $('[data-charid=' + char.cid + ']').html('' +
                        // formatted for easier reading
                        '<div class="slot-name">' +
                        '<div class="slot-name-wrapper"><p><span id="slot-player-name">' + char.firstname + ' ' + char.lastname +'</span></p><br>' +
                        '<button class="play-button" data-cid="' + char.cid + '">Select</button></br><br>' +
                        '<button class="delete-button" data-cid="' + char.cid + '">Perma</button></br></div>'
                    );
                })
            }
        }

What's wrong with this?
 
Top