RyanUSNS

Slammer

Oct 30th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 17
  2. local createdVehicle, myBlip
  3. function joinHandler()
  4.     spawnPlayer(source, spawnX, spawnY, spawnZ)
  5.     fadeCamera(source, true)
  6.     setCameraTarget(source, source)
  7.     outputChatBox("Welcomezzz babe!", source)
  8. end
  9. addEventHandler("onPlayerJoin", root, joinHandler)
  10.  
  11. function createVehicleForPlayer(thePlayer, command, vehicleModel, blip)
  12.     local x, y, z = getElementPosition(thePlayer)
  13.     x = x + 5
  14.     y = y + 10
  15.     if (createdVehicle) then
  16.         destroyElement(createdVehicle)
  17.     end
  18.     createdVehicle = createVehicle(tonumber(vehicleModel), x, y, z)
  19.     if (not createdVehicle) then
  20.         outputChatBox("failed to create veh!", thePlayer)
  21.     end
  22.     if (myBlip) then
  23.         destroyElement(myBlip)
  24.     end
  25.     myBlip = createBlipAttachedTo(createdVehicle, blip)
  26. end
  27. addCommandHandler("createveh", createVehicleForPlayer)
Advertisement
Add Comment
Please, Sign In to add comment