[FiveM] 3 suggestions/ideas

Jay

Thread Junky
=(e)=
Joined
Feb 17, 2018
Messages
824
[FiveM] 4* suggestions/ideas

After messing around on a test server with ways to "improve" the server, I have come up with the following ideas

1) Dedicated Supporter - Custom phone numbers
A simple number change in the database of `users` under `phone_number` could allow people to have a custom number to be reached at via text/call
View attachment 21076
View attachment 21077

2) Police - "/cuff" command - NOT TESTED
This would go in the esx_policejob/client/main.lua - Can go anywhere
Allows the officer to use "/cuff" instead of going through the F6 menu
Code:
RegisterCommand("cuff", function(source, args, raw)
	local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
	if PlayerData.job ~= nil and PlayerData.job.name == 'police' then
		if closestPlayer ~= -1 and closestDistance <= 3.0 then
			TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer))
		else
			ESX.ShowNotification('No player found.')
		end
	else
		ESX.ShowNotification('You are not a Police officer.')
	end
end, false)

3) No more "Sunday Driver"
This is the "included stop-without-reversing and brake-light-hold feature"
I've always found this useless when trying to get away or trying to drive normally - can be a bit annoying
This can be found in the "RealisticVehicleFailure" resource in the config.lua
Code:
sundayDriver = true
Set this to false


4) Better "Show ID" button and code - Lag'B'Gone! ( https://i.imgur.com/k2JZwDA.gif )
The following code can replace the current "Show ID" button that we have. This does not make it stutter and almost unreadable like the current one we have.
Code:
local red = 255
local green = 255
local blue = 255

function DrawText3D(x,y,z, text) 
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
    local scale = (1/dist)*0.8
    local fov = (1/GetGameplayCamFov())*100
    local scale = scale*fov
    
    if onScreen then
        SetTextScale(1*scale, 2*scale)
        SetTextFont(0)
        SetTextProportional(1)
        SetTextColour(red, green, blue, 255)
        SetTextDropshadow(0, 0, 0, 0, 255)
        SetTextEdge(2, 0, 0, 0, 150)
        SetTextDropShadow()
        SetTextOutline()
        SetTextEntry("STRING")
        SetTextCentre(1)
        AddTextComponentString(text)
        World3dToScreen2d(x,y,z, 0)
        DrawText(_x,_y)
    end
end

Citizen.CreateThread(function ()
    while true do
        for i=0,99 do
            N_0x31698aa80e0223f8(i)
        end
        for id = 0, 255 do --1stink ready
            if  NetworkIsPlayerActive( id ) then --and GetPlayerPed( id ) ~= GetPlayerPed( -1 ) then
                x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
                x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
                distance = math.floor(GetDistanceBetweenCoords(x1,  y1,  z1,  x2,  y2,  z2,  true))
                if IsControlPressed(1,166) and (distance < 10) then
                    if NetworkIsPlayerTalking(id) then
                        red = 60
                        green = 60
                        blue = 255
                        DrawText3D(x2, y2, z2 + 1.5, GetPlayerServerId(id))
                    else
                        red = 255
                        green = 255
                        blue = 255
                        DrawText3D(x2, y2, z2 + 1.5, GetPlayerServerId(id))
                    end
                end  
            end
        end
        Citizen.Wait(0)
    end
end)
This current code will allow players to hold F5 and show the ID's of players around them in 10 in-game meters or what ever the measurement is (including theirs) -- (Credit to https://github.com/DevLanceGood/fivem-toggleid - I just made some adjustments and removed some useless stuff :p)
 
Last edited by a moderator:
Upvote 0
I could probably change the f5 to the 9 we use currently.
 
Greens are in. Going to be discussing /cuff some point today.
 
Back
Top