Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. addCommandHandler("getcar",function(thePlayer, commandName, id)
  2.     if getElementData(thePlayer, "adminlevel") >= 1 then
  3.         if not (id) then
  4.             outputChatBox("#3D7ABC[DoubleMTA]#ffffff /" .. commandName .. " #3D7ABC[ID]", thePlayer, 0, 0 ,0, true)
  5.         else
  6.             local theVehicle = findVehicleWhereID(tonumber(id))
  7.             if getElementData(theVehicle, "isInUsedShop") then
  8.                 return end
  9.                 if theVehicle then
  10.                     local r = getPedRotation(thePlayer)
  11.                     local x, y, z = getElementPosition(thePlayer)
  12.                     x = x + ( ( math.cos ( math.rad ( r ) ) ) * 5 )
  13.                     y = y + ( ( math.sin ( math.rad ( r ) ) ) * 5 )
  14.                    
  15.                     if  (getElementHealth(theVehicle)==0) then
  16.                         spawnVehicle(theVehicle, x, y, z, 0, 0, r)
  17.                     else
  18.                         setElementPosition(theVehicle, x, y, z)
  19.                         setVehicleRotation(theVehicle, 0, 0, r)
  20.                     end
  21.                    
  22.                     setElementInterior(theVehicle, getElementInterior(thePlayer))
  23.                     setElementDimension(theVehicle, getElementDimension(thePlayer))
  24.  
  25.                     outputChatBox("#3D7ABC[DoubleMTA]#ffffff Jármû teleportálva lett a pozíciódra.", thePlayer, 0, 0, 0, true)
  26.                     exports.dm_core:sendMessageToAdmins("#ffffff (" .. getPlayerAdminTitle(thePlayer) .. ") " .. getPlayerAdminNick(thePlayer) .. " használta a#D23131 /" .. commandName .. "#ffffff parancsot", 0, 0, 0, true)
  27.                 else
  28.                     outputChatBox("#3D7ABC[DoubleMTA]#ffffff Érvénytelen jármû ID.", thePlayer, 0, 0, 0, true)
  29.                 end
  30.         end
  31.     end
  32. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement