-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Added Test Drive, Categories
- Loading branch information
1 parent
e0d7664
commit decd92d
Showing
12 changed files
with
461 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
local testDriving = false | ||
local testVehicle | ||
local testShop | ||
|
||
RegisterNUICallback('testDrive', function(data, cb) | ||
ESX.TriggerServerCallback('h-vshop:testDrive', function(success) | ||
print(success) | ||
if success then | ||
testDriving = true | ||
local shop = Utils.getShop() | ||
testShop = shop | ||
|
||
if shop then | ||
local sPos = shop.delivery.pos | ||
local sHeading = shop.delivery.heading | ||
ESX.Game.SpawnLocalVehicle(data.vehicle, sPos, heading, function(vehicle) | ||
testVehicle = vehicle | ||
print('Test vehicle spawned: '..vehicle) | ||
end) | ||
Wait(100) | ||
SetPedIntoVehicle(PlayerPedId(), testVehicle, -1) | ||
StartTestTimer() | ||
end | ||
cb(true) | ||
else | ||
cb(false) | ||
end | ||
end, data.vehicle) | ||
end) | ||
|
||
RegisterNUICallback('stopTestDrive', function(data, cb) | ||
if testDriving then | ||
testDriving = false | ||
SendNUIMessage({ | ||
type = 'stopTimer', | ||
}) | ||
ESX.Game.DeleteVehicle(testVehicle) | ||
SetEntityCoords(PlayerPedId(), testShop.pos) | ||
ESX.TriggerServerCallback('h-vshop:removeBucket', function(success) | ||
if not success then | ||
print('Failed to remove bucket') | ||
end | ||
end) | ||
cb(true) | ||
else | ||
cb(false) | ||
end | ||
end) | ||
|
||
local testTime = Config.TestTime | ||
StartTestTimer = function () | ||
SendNUIMessage({ | ||
type = 'startTimer', | ||
time = testTime | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.