Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix engine start keybind and add keyfob prop #150

Closed
wants to merge 6 commits into from

Conversation

justshoveit
Copy link

@justshoveit justshoveit commented Oct 25, 2024

Description

  • Fix engine start keybind
  • Add Keyfob prop for lock/unlock

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

client/main.lua Outdated Show resolved Hide resolved
Comment on lines +31 to +55
AttachEntityToEntity(
key,
cache.ped,
GetPedBoneIndex(cache.ped, 57005),
0.10,
0.02,
0,
48.10,
23.14,
24.14,
true,
true,
false,
true,
1,
true
)
SetModelAsNoLongerNeeded(key)
SetTimeout(
1250,
function()
ClearPedTasks(cache.ped)
DeleteEntity(key)
end
)
Copy link
Contributor

@solareon solareon Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AttachEntityToEntity(
key,
cache.ped,
GetPedBoneIndex(cache.ped, 57005),
0.10,
0.02,
0,
48.10,
23.14,
24.14,
true,
true,
false,
true,
1,
true
)
SetModelAsNoLongerNeeded(key)
SetTimeout(
1250,
function()
ClearPedTasks(cache.ped)
DeleteEntity(key)
end
)
AttachEntityToEntity(key, cache.ped, GetPedBoneIndex(cache.ped, 57005), 0.10, 0.02, 0, 48.10, 23.14, 24.14, true, true, false, true, 1, true)
SetModelAsNoLongerNeeded(key)
SetTimeout(1250, function()
ClearPedTasks(cache.ped)
DeleteEntity(key)
end)

Don't unfold all the lines as this makes it difficult to follow what is happening.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally I believe this should be called before the animation as lib.playAnim is not async so we can then remove the SetTimeout and just delete the entity after lib.playAnim

client/main.lua Outdated Show resolved Hide resolved
Comment on lines +261 to +262
TriggerServerEvent('qb-vehiclekeys:server:setVehLockState',
NetworkGetNetworkIdFromEntity(leftVehicle), 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TriggerServerEvent('qb-vehiclekeys:server:setVehLockState',
NetworkGetNetworkIdFromEntity(leftVehicle), 2)
TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(leftVehicle), 2)

Same deal with the earlier formatting

client/main.lua Outdated Show resolved Hide resolved
@justshoveit
Copy link
Author

I'll update it accordingly. Idk why my word wrap messed with the formatting and indent. Was doing it on my phone 😅

justshoveit and others added 3 commits October 25, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants