Advertisement
Guest User

Untitled

a guest
Jul 11th, 2016
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.23 KB | None | 0 0
  1. -- Alternate Exit Vehicle Script
  2. -- by the Driver
  3. -- Edit by mrboss27
  4.  
  5. key = {}
  6.  
  7. key.ctrl = 17 -- "Control" modifier used with the keys below (eg. Ctrl+A for left turn signal)
  8. key.defaultkey = 70 -- "F"
  9.  
  10. -- KEY CODES:
  11. ------------------------------------
  12. -- Keys.None = 0
  13. -- Keys.LButton = 1
  14. -- Keys.RButton = 2
  15. -- Keys.Cancel = 3
  16. -- Keys.MButton = 4
  17. -- Keys.XButton1 = 5
  18. -- Keys.XButton2 = 6
  19. -- Keys.Back = 8
  20. -- Keys.Tab = 9
  21. -- Keys.LineFeed = 10
  22. -- Keys.Clear = 12
  23. -- Keys.Return = 13
  24. -- Keys.ShiftKey = 16
  25. -- Keys.ControlKey = 17
  26. -- Keys.Menu = 18
  27. -- Keys.Pause = 19
  28. -- Keys.Capital = 20
  29. -- Keys.KanaMode = 21
  30. -- Keys.JunjaMode = 23
  31. -- Keys.FinalMode = 24
  32. -- Keys.HanjaMode = 25
  33. -- Keys.Escape = 27
  34. -- Keys.IMEConvert = 28
  35. -- Keys.IMENonconvert = 29
  36. -- Keys.IMEAceept = 30
  37. -- Keys.IMEModeChange = 31
  38. -- Keys.Space = 32
  39. -- Keys.PageUp = 33
  40. -- Keys.Next = 34
  41. -- Keys.End = 35
  42. -- Keys.Home = 36
  43. -- Keys.Left = 37
  44. -- Keys.Up = 38
  45. -- Keys.Right = 39
  46. -- Keys.Down = 40
  47. -- Keys.Select = 41
  48. -- Keys.Print = 42
  49. -- Keys.Execute = 43
  50. -- Keys.PrintScreen = 44
  51. -- Keys.Insert = 45
  52. -- Keys.Delete = 46
  53. -- Keys.Help = 47
  54. -- Keys.D0 = 48
  55. -- Keys.D1 = 49
  56. -- Keys.D2 = 50
  57. -- Keys.D3 = 51
  58. -- Keys.D4 = 52
  59. -- Keys.D5 = 53
  60. -- Keys.D6 = 54
  61. -- Keys.D7 = 55
  62. -- Keys.D8 = 56
  63. -- Keys.D9 = 57
  64. -- Keys.A = 65
  65. -- Keys.B = 66
  66. -- Keys.C = 67
  67. -- Keys.D = 68
  68. -- Keys.E = 69
  69. -- Keys.F = 70
  70. -- Keys.G = 71
  71. -- Keys.H = 72
  72. -- Keys.I = 73
  73. -- Keys.J = 74
  74. -- Keys.K = 75
  75. -- Keys.L = 76
  76. -- Keys.M = 77
  77. -- Keys.N = 78
  78. -- Keys.O = 79
  79. -- Keys.P = 80
  80. -- Keys.Q = 81
  81. -- Keys.R = 82
  82. -- Keys.S = 83
  83. -- Keys.T = 84
  84. -- Keys.U = 85
  85. -- Keys.V = 86
  86. -- Keys.W = 87
  87. -- Keys.X = 88
  88. -- Keys.Y = 89
  89. -- Keys.Z = 90
  90. -- Keys.LWin = 91
  91. -- Keys.RWin = 92
  92. -- Keys.Apps = 93
  93. -- Keys.Sleep = 95
  94. -- Keys.NumPad0 = 96
  95. -- Keys.NumPad1 = 97
  96. -- Keys.NumPad2 = 98
  97. -- Keys.NumPad3 = 99
  98. -- Keys.NumPad4 = 100
  99. -- Keys.NumPad5 = 101
  100. -- Keys.NumPad6 = 102
  101. -- Keys.NumPad7 = 103
  102. -- Keys.NumPad8 = 104
  103. -- Keys.NumPad9 = 105
  104. -- Keys.Multiply = 106
  105. -- Keys.Add = 107
  106. -- Keys.Separator = 108
  107. -- Keys.Subtract = 109
  108. -- Keys.Decimal = 110
  109. -- Keys.Divide = 111
  110. -- Keys.F1 = 112
  111. -- Keys.F2 = 113
  112. -- Keys.F3 = 114
  113. -- Keys.F4 = 115
  114. -- Keys.F5 = 116
  115. -- Keys.F6 = 117
  116. -- Keys.F7 = 118
  117. -- Keys.F8 = 119
  118. -- Keys.F9 = 120
  119. -- Keys.F10 = 121
  120. -- Keys.F11 = 122
  121. -- Keys.F12 = 123
  122. -- Keys.F13 = 124
  123. -- Keys.F14 = 125
  124. -- Keys.F15 = 126
  125. -- Keys.F16 = 127
  126. -- Keys.F17 = 128
  127. -- Keys.F18 = 129
  128. -- Keys.F19 = 130
  129. -- Keys.F20 = 131
  130. -- Keys.F21 = 132
  131. -- Keys.F22 = 133
  132. -- Keys.F23 = 134
  133. -- Keys.F24 = 135
  134. -- Keys.NumLock = 144
  135. -- Keys.Scroll = 145
  136. -- Keys.LShiftKey = 160
  137. -- Keys.RShiftKey = 161
  138. -- Keys.LControlKey = 162
  139. -- Keys.RControlKey = 163
  140. -- Keys.LMenu = 164
  141. -- Keys.RMenu = 165
  142. -- Keys.BrowserBack = 166
  143. -- Keys.BrowserForward = 167
  144. -- Keys.BrowserRefresh = 168
  145. -- Keys.BrowserStop = 169
  146. -- Keys.BrowserSearch = 170
  147. -- Keys.BrowserFavorites = 171
  148. -- Keys.BrowserHome = 172
  149. -- Keys.VolumeMute = 173
  150. -- Keys.VolumeDown = 174
  151. -- Keys.VolumeUp = 175
  152. -- Keys.MediaNextTrack = 176
  153. -- Keys.MediaPreviousTrack = 177
  154. -- Keys.MediaStop = 178
  155. -- Keys.MediaPlayPause = 179
  156. -- Keys.LaunchMail = 180
  157. -- Keys.SelectMedia = 181
  158. -- Keys.LaunchApplication1 = 182
  159. -- Keys.LaunchApplication2 = 183
  160. -- Keys.Oem1 = 186
  161. -- Keys.Oemplus = 187
  162. -- Keys.Oemcomma = 188
  163. -- Keys.OemMinus = 189
  164. -- Keys.OemPeriod = 190
  165. -- Keys.OemQuestion = 191
  166. -- Keys.Oemtilde = 192
  167. -- Keys.OemOpenBrackets = 219
  168. -- Keys.Oem5 = 220
  169. -- Keys.Oem6 = 221
  170. -- Keys.Oem7 = 222
  171. -- Keys.Oem8 = 223
  172. -- Keys.OemBackslash = 226
  173. -- Keys.ProcessKey = 229
  174. -- Keys.Packet = 231
  175. -- Keys.Attn = 246
  176. -- Keys.Crsel = 247
  177. -- Keys.Exsel = 248
  178. -- Keys.EraseEof = 249
  179. -- Keys.Play = 250
  180. -- Keys.Zoom = 251
  181. -- Keys.NoName = 252
  182. -- Keys.Pa1 = 253
  183. -- Keys.OemClear = 254
  184. -- Keys.KeyCode = 65535
  185. -- Keys.Shift = 65536
  186. -- Keys.Control = 131072
  187. -- Keys.Alt = 262144
  188. -- Keys.Modifiers = -65536
  189. ------------------------------------
  190.  
  191. local lve = {}
  192.  
  193. local tickt = 0
  194. local loop = false
  195.  
  196. function lve.tick()
  197. playerPed = PLAYER.PLAYER_PED_ID()
  198. player = PLAYER.GET_PLAYER_PED(playerPed)
  199. playerVehicle = PED.GET_VEHICLE_PED_IS_USING(playerPed)
  200. isPlayerDriving = (VEHICLE.GET_PED_IN_VEHICLE_SEAT(playerVehicle, -1) == playerPed)
  201.  
  202.  
  203.  
  204. if (loop and tickt < 500) then
  205. if (isPlayerDriving) then
  206. lve.leaveVehicle()
  207. end
  208. tickt = tickt + 1
  209. return 0
  210. else
  211. loop = false
  212. tickt = 0
  213. end
  214.  
  215. -- "F" to leave vehicle with engine on, "CTRL" + "F" to leave with engine off
  216. if(get_key_pressed(key.defaultkey)) then
  217. wait(250)
  218. if(get_key_pressed(key.defaultkey)) then
  219. if (isPlayerDriving == true) then
  220. lve.leaveVehicleEngineOff()
  221. end
  222. else
  223. if (isPlayerDriving == true) then
  224. lve.leaveVehicle()
  225. end
  226. end
  227. wait(1000)
  228. end
  229. end
  230.  
  231. function lve.leaveVehicle()
  232. VEHICLE.SET_VEHICLE_ENGINE_ON(playerVehicle, true, true)
  233. end
  234.  
  235. function lve.leaveVehicleEngineOff()
  236. VEHICLE.SET_VEHICLE_ENGINE_ON(playerVehicle, false, true)
  237. end
  238.  
  239. function lve.init()
  240. end
  241.  
  242. function lve.unload()
  243. end
  244.  
  245. return lve
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement