Hi everyone if you want some secret car in your map here we go !
__resource.lua
client_script "client.lua"
client.lua
Citizen.CreateThread(function()
-- Parked vehicles.
local vehicles = {
-- Locations
{Model= "tyrus", X= 2669.716, Y= 3517.079, Z= 51.981, A= 0},
{Model= "tyrus", X= 2673.525, Y= 3526.788, Z= 51.710, A= 0},
}
-- Spawn the secret cars
for _, item in pairs(vehicles) do
RequestModel(GetHashKey(item.Model));
while not HasModelLoaded(GetHashKey(item.Model)) do
RequestModel(GetHashKey(item.Model));
Wait(1);
end
vehicle = CreateVehicle(GetHashKey(item.Model), item.X, item.Y, item.Z, item.A, false, false)
SetVehicleOnGroundProperly(vehicle)
end
end)
Create a folder in your ressource ( secretcar ). Dont forget to put the file name in your ( citmp-server.yml )
This is the secret cars location. You can change the location/car for whatever you want and have fun
feel free to make the script better
Issue: Car only in Local