Well, I am trying to pass the hasKeys(plate) function to the server-side so when players disconnect don’t have to hotwire their own vehicles - but I faced some problems trying to make it work
I’m not even sure if that’s the right way to do it or do I need to create a variable for it
here’s my code so far:
TriggerServerEvent('pb-hotwire:server:givePlayerKeys', plate)
I used this to call a server event instead of using the giveplayerkeys directly
This is the server event:
RegisterServerEvent('pb-hotwire:server:givePlayerKeys')
AddEventHandler('pb-hotwire:server:givePlayerKeys', function(plate)
TriggerClientEvent('pb-hotwire:client:givePlayerKeys', source, plate)
end)
and this is what I added on my client.lua
RegisterNetEvent('pb-hotwire:client:givePlayerKeys')
AddEventHandler('pb-hotwire:client:givePlayerKeys', function(plate)
givePlayerKeys(plate)
end)
givePlayerKeys() function
function givePlayerKeys(plate)
local vehPlate = plate
table.insert(vehicles, vehPlate)
end
My second though was to use a second variable but I really do not know the right way to do this
I tried several stuff and looked over different scripts but I couldn’t succeed in the end
I hope someone will help
