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
2
votes
0 answers
Can't figure out how to use Microsoft.Data.Sqlite in .NET Standard 2.0
for a while now I've been trying to connect to my local SQLite3 database through a C# project. The project is a FiveM (which is a modification of GtaV) resource, so it works with the CitizenFX framework.
In particular, I'm creating a server-side…

Ghostino
- 21
- 2
2
votes
3 answers
An object reference is required for the non-static field, method, or property 'Player.Name' (FiveM
I'm new to C# and I am trying to get the basics under my belt, so far every problem I've ran into has been solved with a quick google search, for some reason this one is just going over my head.
I'm attempting to assign a string to the value that I…

jam0935
- 23
- 3
2
votes
0 answers
How can i limit tat RegisterNetEvent to a job?
Hey there i have a question, i work on a panic button on fivem.
It works fine but how can i limit it that only certain jobs can really trigger that triggerServerEvent which triggers the dispatch to be…

user20138634
- 21
- 1
2
votes
1 answer
Open application with explorer.exe but with settings added
When I run this from notepad .bat file it open my application. But when I add ?streamermode=1 at the end it just open blank folder.
explorer.exe fivem://connect/IP --> works
explorer.exe fivem://connect/IP?streamerMode=1 --> does not work

Azer
- 33
- 3
1
vote
0 answers
Cannot update self in lua class?
function _GetWhitelist(name)
if not _whitelists[name] then
print('Unable to get whitelist ('..name..') - does not exist')
return false
end
local Whitelist = {}
Whitelist.__index = Whitelist
function…

James Scott
- 26
- 4
1
vote
0 answers
Issue with NetworkCallbackDelegate
I'm searching to get some players infos from a database with events in C#.
When I try my script in game, this error message appears :
[ 9419687] [b2699_GTAProce] MainThrd/ System.NullReferenceException: Object reference not set to an…

Dylan Pageot
- 11
- 2
1
vote
1 answer
Error running lua script: Attempt to index a nil value
I am new to scripting in lua, but I try to fix an existing script. It's a script that can be used in FiveM. It is used to impound vehicles. This is the code:
Line 1:
local currentTask = {}
Starting at line 852:
852 elseif action == 'impound'…

user3421696
- 37
- 4
1
vote
1 answer
Using Insert with a large multi-layered table using Lua
So I am working on a script for GTA5 and I need to transfer data over to a js script. However so I don't need to send multiple arrays to js I require a table, the template for the table should appear as below.
The issue I'm having at the moment is…

Latisimus Firestorm
- 13
- 2
1
vote
0 answers
How would I compare results in lua
DISCLAIMER: The title is bad but I dont know how else to word it
Issue: I am trying to compare entities in a FiveM script I am working on and tell if a player is close to a valid animal model and I cant get it to work and the only model being…

Kyle Styx
- 65
- 5
1
vote
1 answer
How to get argument on serverside server callback fivem
So i'm very new to lua and I wrote this:
Clientside
ESX.TriggerServerCallback('mapbuilder:getMoney', function(money)
if selectedmatamount == nil or money >= selectedmatamount then
…

Benzy YT
- 11
- 3
1
vote
2 answers
LUA unexpected symbol near ')' line local society =
RegisterServerEvent('esx_society:depositMoney')
AddEventHandler('esx_society:depositMoney', function(society, amount)
local xPlayer = ESX.GetPlayerFromId(source)
local society = 'society_mechanic', function(society)
if amount > 0 and…

Chnewi
- 11
- 3
1
vote
1 answer
How to randomise multiple table values
I am new to lua so sorry if my code may look bad, I have been trying to randomize the x, y, z values in a table without a success.
How could I do so?
Here is an error I get:
Error loading script jobs/poolworker.lua in resource esx_jobs:…

Bakaguya
- 29
- 5
1
vote
1 answer
Variable with multiple values to use
Im editing a script for fivem and Im trying to store multiple values into a variable then using an if statement to see if a player has one of the values in his inventory. So far i have this
Config.ItemVapeLiquid = 'liquid', 'liquidice',…

VloneSama
- 13
- 2
1
vote
1 answer
xPlayer is null just after a player login
I have a FiveM script on the server side. The script fails to set xPlayer when I connect, when I reload the script once connected to the server everything works as expected.
RegisterServerEvent("eventScript:Ping", function()
local _source =…

Magicien_ghost
- 11
- 3
1
vote
1 answer
FiveM Lua: Fivem > Web > Fivem
Struggling with this API. It works on postman - expected steps:
1- User completes chat command /user [id].
2- Script calls the API and passes [id].
3- API search DB for users with that id.
4- API passes back the username of that user and prints it…

Patrick Breathen
- 11
- 4