Advertisement
Noneatme

Untitled

Nov 18th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1.  
  2. local cFunc = {}
  3. local cSetting = {}
  4.  
  5.  
  6. -- FUNCTIONS --
  7.  
  8. cSetting["allowed"] = {
  9.     [606] = true,
  10. }
  11.  
  12. cFunc["checkTrailer"] = function()
  13.     if(isPedInVehicle(localPlayer) == false) then
  14.         local x, y, z = getElementPosition(localPlayer)
  15.         local col = createColSphere(x, y, z, 10)
  16.         setTimer(function()
  17.             for index, car in pairs(getElementsWithinColShape(col)) do
  18.                 if(cSetting["allowed"][getElementModel(car)] == true) then
  19.                     triggerServerEvent("doTrailerEinsteigen", localPlayer, car)
  20.                     destroyElement(col)
  21.                     break;
  22.                 end
  23.             end
  24.             if(isElement(col)) then
  25.                 destroyElement(col)
  26.             end
  27.         end, 50, 1)
  28.     end
  29. end
  30.  
  31. bindKey("enter_exit", "down", cFunc["checkTrailer"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement