This tag is for questions related to the multiplayer modification FiveM for Grand Theft Auto V enabling you to play multiplayer on customized dedicated servers by Cfx.re.
Questions tagged [fivem]
173 questions
1
vote
1 answer
Lua - Help sorting table array alphabetical from value inside itself
I'm fairly new to lua coding, been doing it for GTAV FiveM scripts
I'm also new here to sorry if I do or say explain something wrong.
I've been trying to make a script that handles the names of wheels, their id and wether or not they are already…

Jim Shield
- 13
- 2
1
vote
1 answer
Using a transition on the position with
Basically, there are elements popping in when my armor is filled up, and I would need a transition for the position change because it just popping up is ugly! The only thing stopping me is I don't know shit about CSS but here's my code for it
#armor…

lathlaszlo
- 11
- 2
1
vote
1 answer
Vehicle Spawning Menu looping infinitely in lua
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = GetPlayerPed()
local rank = exports.XpM:XPM_GetRank() --Gets the rank of the player from XP system XpM
print('Rank:' .. rank)
if…

Siddharth Harshit
- 11
- 1
1
vote
1 answer
Amount bug when giving items
I need your help for a minute.
We have the problem that players can assign more things in the inventory than normally possible (example: I don't have "25" sandwiches but if I enter "025" as value I can give 25 to another player).
Does anyone know…

Tendo1991
- 13
- 2
1
vote
0 answers
attempt to index a nil value (local 'result') error
i'm not a coder, but i'm trying to learn how to make a fivem server, and I keep getting an error that says
@es_extended/server/main.lua:93: attempt to index a nil value (local 'result')
i'm trying to solve this error but it's being hard.
here is…

Nuno Aguiar
- 11
- 2
1
vote
0 answers
Lua Mouse Drag Quaternion
I am looking for a bit of help with this lua script I am making. I want to use Quaternion's to rotate an object based on your mouse movement/drag. I am using this library for my Quaternion https://github.com/topameng/CsToLua/ . I have got the object…

Peter Greek
- 27
- 4
1
vote
1 answer
Restricting commands to procedure only in MySQL / MariaDB
I've put together a FiveM server using alot of public code and discovered there are cheat systems out there that allow the user to corrupt or delete the underlying database. The reason is because they can inject Lua scripts which can contain DROP,…

Stephen York
- 1,247
- 1
- 13
- 42
1
vote
0 answers
Load code from string without using loadstring() function
There is any way to load code from string without using a loadstring() function?
For example:
local code = {
{
Code = [[
function DoSomething()
print('making something')
end
]]
},
…

MuDzYn.
- 11
- 1
1
vote
1 answer
Lua oop static object value
How would I make self.character.data().bank the same to all instances of the class
even when using the function setBank? currently when using setBank it only updates self.character.data().bank on the one instance if it makes sense
_G.GetUser = {
…

Fnug
- 23
- 5
1
vote
2 answers
Problems with decoding JSON in lua
I have the following code:
PerformHttpRequest('http://ossie.dk/API/verify.json',function(err, text, headers)
local r=json.decode(text)
for s,t in pairs(r.servers)do
print(t)
end
end,"GET","",{})
My problem is,…

OssieFromDK
- 51
- 2
- 6
1
vote
3 answers
ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
MySQL.Async.fetchAll('INSERT INTO position (id, x, y, z) VALUES (@id, @x, @y, @z)',
{['@id'] = identifier, ['@x'] = coords.x, ['@y'] = coords.z, ['@z'] = coords.z})
Hi. I'm learning to programm and I've written the simple command above for my…
user11786059
1
vote
1 answer
Error running call reference function for resource es_extended fiveM
Basically have another fivem es_extended issue where I am getting unwelcome errors everytime users try and join my server and show their money as undefined, and also not allow them to save their clothing.
I've dropped tables from my database and…

Dans
- 33
- 5
0
votes
0 answers
RageMP Server convert to FiveM?
I have a full RageMP Roleplay server and would like to port all the features and scripts to FiveM to make them work. Could someone help me or show me how to do this?
Maybe someone who could do it for me or could show me how i could do it

Artur
- 1
0
votes
0 answers
Attempt to index a nil value items (help!)
So I am getting the error
[script:tb_fuel] SCRIPT ERROR: @tb_fuel/config.lua:117: attempt to index a nil value (global 'ESX')
[script:tb_fuel] > getplayer (@tb_fuel/config.lua:117)`,
I have no idea what is causing this and how to fix it.
Code from…

EthanP
- 1
- 4
0
votes
0 answers
QB-core server is not working I can load in but I just cant select a location and it is a black screen
SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:739: SCRIPT ERROR: @qb-core/server/player.lua:162: No such export LoadInventory in resource qb-inventory
i have updated my mysql. and all there is a blakc screen than should be my location spawn…