Hi all what do you think of my Interaction Menu

Just learnt Lua 2 months ago, my first langage, and this is not nativeui its full in lua, what do you think of this ? I tried to remake the ampi menu of gta online :slight_smile: :upside_down_face:

1 Like

That’s actually very nice! :slightly_smiling_face:
I’ve had the idea of creating a gta online like menu for interactions but I have to learn how to code a menu.

Do you plan sharing it?

Hello, that’s look very good ! I’m trying to add ā€œdonner de l’argentā€ function in my server since 2hours can you give me your client and server function for giving money to nearest player please ? It’s the only things my server don’t have :frowning:

thanks my friend its very cool

-- Client

function getPlayers()
    local playerList = {}
    for i = 0, 32 do
        local player = GetPlayerFromServerId(i)
        if NetworkIsPlayerActive(player) then
            table.insert(playerList, player)
        end
    end
    return playerList
end

function getNearPlayer()
    local players = getPlayers()
    local pos = GetEntityCoords(GetPlayerPed(-1))
    local pos2
    local distance
    local minDistance = 3
    local playerNear
    for _, player in pairs(players) do
        pos2 = GetEntityCoords(GetPlayerPed(player))
        distance = GetDistanceBetweenCoords(pos["x"], pos["y"], pos["z"], pos2["x"], pos2["y"], pos2["z"], true)
        if (pos ~= pos2 and distance < minDistance) then
            playerNear = player
            minDistance = distance
        end
    end
    if (minDistance < 3) then
        return playerNear
    end
end

function giveMoney()
    local playerNear = getNearPlayer()
    if playerNear then
        DisplayOnscreenKeyboard(1, "FMMC_MPM_TYP8", "", "", "", "", "", 30)
        while (UpdateOnscreenKeyboard() == 0) do
            DisableAllControlActions(0);
            Wait(0);
        end
        if (GetOnscreenKeyboardResult()) then
            local res = tonumber(GetOnscreenKeyboardResult())
            if res > 0 then
                TriggerServerEvent("player:swapMoney", res, GetPlayerServerId(playerNear))
            end
        end
    else
        Notify("~h~~r~Il n'y a pas de joueur proche.")
    end
end
-- Server

RegisterServerEvent("player:swapMoney")
AddEventHandler("player:swapMoney", function(amount, target)
    TriggerEvent('es:getPlayerFromId', source, function(user)
        if user.money - amount >= 0 then
            user:removeMoney(amount)
            TriggerEvent('es:getPlayerFromId', target, function(user) user:addMoney(amount) end)
        end
    end)
end)

that’s nativeui why u always say that’s full lua -_-

yes sure here we can see a lot of nativeui (link removed)

NATIVEUI Your menu

You see ? It’s normal if u can’t know if it’s a lua menu or a nativeui because that’s a menu made by Maeen

" are u retarded " lol, you don’t know if your menu it’s a nativeui or not

yes okay what the fuck

someone can help me please i dont know if this if fivem or this is gta_network im lost

2 Likes

Isn’t NativeUI only accessible using C#?

That’s not clear to me atm, I though there was 3 main ways to create UI (I can be wrong):

  • NativeUI using C# only
  • Gta Natives using Lua or C#
  • Combine Lua or C# with HTML, CSS, JQuery

If we can create a NativeUI using Lua, I would be very interested.

Yes my UI is written in Lua, 2000 lines but apparently its NativeUI and i dont know if my code is in lua or CSharp or html

Nice !
If its full LUA, gj

dis is my ls custom https://cdn.discordapp.com/attachments/300949296990126081/327099610743177216/unknown.png

dis is my foodshops https://cdn.discordapp.com/attachments/300952218595753984/327101157933580298/unknown.png

dis is my ammu-nations https://cdn.discordapp.com/attachments/300952218595753984/327101899914477568/unknown.png

inchallah i release this when all its finished, it will be a new gamemode released on fivem, gta:online rp, 200% ez to edit with lua

lol :upside_down_face:

Ahah, I hope it’ll be release soon then :stuck_out_tongue:

GIVE IT TO ME PLS man