redyydev / ry_rent

GNU General Public License v2.0
19 stars 11 forks source link

Vehicle Keys #6

Open happensinthegame opened 4 months ago

happensinthegame commented 4 months ago

For some reason, I don't get the vehicle keys after choosing a vehicle for rental and I don't see GiveKeys or anything related in the script. Is there a way to receive the keys?

wilodonny commented 4 months ago

functions.txt I have semi fixed this assuming you use qb-core , i dont know how to add the code into the github for you to just copy paste so i have provided in a .txt format just rename to functions.lua and replace yours after making a backup incase you need to revert back to it in the ry_rent/client folder.

this does give an error in txadmin of

[ script:qb-core] SCRIPT ERROR: @qb-core/server/player.lua:295: bad argument #1 to 'floor' (number expected, got nil) [ script:qb-core] > ref (@qb-core/server/player.lua:295) [ script:qb-core] > handler (@ry_rent/server/main.lua:69) [ script:ry_rent] SCRIPT ERROR: error object is not a string

which hopefully the creator can resolve but even though this error triggers it works fine for me with qb-vehiclekeys version 1.2.5

redyydev commented 4 months ago

Hello, thank you @wilodonny for helping. Im on vacation but when i come back i'il add the function for vehicle keys and some news too.

Replying to the error, maybe try this replace: TriggerServerEvent("qb-vehiclekeys:server:AcquireVehicleKeys", plate) with: TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(vehicle))