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

Set custom plat number for other vehicle lock script #8

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Update main.lua
  • Loading branch information
ayobpro committed Apr 21, 2020
commit abd5b765459b796953460d3478579b010c4a18b7
4 changes: 4 additions & 0 deletions client/main.lua
Expand Up @@ -454,24 +454,28 @@ function SpawnDeliveryVehicle(deliveryType)

local Rnd = GetRandomFromRange(1, #Config.ParkingSpawns)
local SpawnLocation = Config.ParkingSpawns[Rnd]
local plate = 'RUNR ' .. math.random(100, 900) -- Plate RUNR + random number

if deliveryType == 'scooter' then
local ModelHash = GetHashKey(Config.Models.scooter)
WaitModelLoad(ModelHash)
CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true)
SetVehicleNumberPlateText(CurrentVehicle, plate)
end

if deliveryType == 'truck' then
local ModelHash = GetHashKey(Config.Models.truck)
WaitModelLoad(ModelHash)
CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true)
SetVehicleNumberPlateText(CurrentVehicle, plate)
SetVehicleLivery(CurrentVehicle, 2)
end

if deliveryType == 'van' then
local ModelHash = GetHashKey(Config.Models.van)
WaitModelLoad(ModelHash)
CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true)
SetVehicleNumberPlateText(CurrentVehicle, plate)
SetVehicleExtra(CurrentVehicle, 2, false)
SetVehicleLivery(CurrentVehicle, 0)
SetVehicleColours(CurrentVehicle, 0, 0)
Expand Down