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
Thatās actually very nice!
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
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)
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
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
Ahah, I hope itāll be release soon then
GIVE IT TO ME PLS man