Just in case anyone is having an issue where people can open menus and have to re log I’ve got a bit of code you add to client.lua and it will stop them opening the menus and phone.
Alright so I’ve tried this multiple times and for some reason not getting any luck if anyone can assit on how to check if a player is in a vehicle and then do something that would be great this is what I got so far.
esx_drugs_sv.lua
if CopsConnected < Config.RequiredCopsCoke then
TriggerClientEvent('esx:showNotification', source, _U('act_imp_police', CopsConnected, Config.RequiredCopsCoke))
return
end
SetTimeout(Config.TimeToProcess, function()
if PlayersTransformingCoke[source] == true then
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local ped = GetPlayerPed(-1)
local cokeQuantity = xPlayer.getInventoryItem('coke').count
local poochQuantity = xPlayer.getInventoryItem('coke_pooch').count
if poochQuantity > 35 then
TriggerClientEvent('esx:showNotification', source, _U('too_many_pouches'))
elseif cokeQuantity < 5 then
TriggerClientEvent('esx:showNotification', source, _U('not_enough_coke'))
elseif IsPedInAnyVehicle(ped) then
TriggerClientEvent('esx:showNotification', source, 'Step outside the vehicle')
else
xPlayer.removeInventoryItem('coke', 5)
xPlayer.addInventoryItem('coke_pooch', 1)
TransformCoke(source)
end
end
end)
end
What I am trying to do is do a check if the player is in a vehicle it will tell them to step outside the vehicle.
elseif IsPedInAnyVehicle(ped) then
TriggerClientEvent('esx:showNotification', source, 'Step outside the vehicle')
else
But for some reason it will not run its giving issues
Error resuming coroutine: server/esx_drugs_sv.lua:114: attempt to call a nil value (global ‘IsPedInAnyVehicle’)
stack traceback:
server/esx_drugs_sv.lua:114: in function <server/esx_drugs_sv.lua:99>
When editing the amount of cops there has to be online for you to be able to collect the drugs the amount of cops doesn’t change and just stays at 2 any help?
So guys, if i want another job not to pickup the drugs… like the cops. where can i find it ? i have been looking all the scripts thouh, and i cant find anything with cops not allowed too pick it up fx…
is there any way I can make the money they earn from selling drugs go to their bank or cash instead of going into the dirty money coloumn? we dont have black market nor do we intend on putting one in.
Yes of course bro, okay last question I got on this script, do I change the inventory limit from main/server or do I go in the actual database for that?
ive been able to use the database with no problems, however ive heard sometimes that wont work so if dosent just make sure you go and change it within the files to force it to listen
Still having issues with inventory limitsAlright guys so I did this from esx_drugs_sv.lua and then straight from my Database, I assigned them both to 30 but it still says coke inventory full, there is 0 coke or anything in my inventory, what am I doing wrong?