Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -builar.lua-
- local cars = {"adder"}
- RegisterCommand("car", function()
- local car = (car[math.random(#cars)])
- spawncar(car)
- notify("~p~Spawned car: ~h~~g~" .. car)
- end)
- -functions.lua-
- function notify(msg)
- SetNotificationTextEntry("STRING")
- AddTextComponentString(msg)
- DrawNotification(true,false)
- end
- function spawncar(car)
- local car = GetHashKey(car)
- RequestModel(car)
- while not hasModelloaded(car) do
- RequestModel(car)
- Citizen.Wait(0)
- end
- local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1), fasle))
- local vehicle = CreateVehicle(car, x +3, y + 3, z + 1, 0.0, true, false)
- SetEntityAsMissionEntity(vehicle, true, true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement