Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. -builar.lua-
  2.  
  3. local cars = {"adder"}
  4. RegisterCommand("car", function()
  5.  
  6. local car = (car[math.random(#cars)])
  7. spawncar(car)
  8. notify("~p~Spawned car: ~h~~g~" .. car)
  9. end)
  10.  
  11. -functions.lua-
  12.  
  13. function notify(msg)
  14. SetNotificationTextEntry("STRING")
  15. AddTextComponentString(msg)
  16. DrawNotification(true,false)
  17. end
  18.  
  19. function spawncar(car)
  20. local car = GetHashKey(car)
  21.  
  22. RequestModel(car)
  23. while not hasModelloaded(car) do
  24. RequestModel(car)
  25. Citizen.Wait(0)
  26. end
  27.  
  28. local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1), fasle))
  29. local vehicle = CreateVehicle(car, x +3, y + 3, z + 1, 0.0, true, false)
  30. SetEntityAsMissionEntity(vehicle, true, true)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement