Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.75 KB | None | 0 0
  1. @name G63
  2. @inputs [Wheels]:array
  3. @inputs [Engine Clutch EGP Pod Tank Tank2 D1 D2 D3]:wirelink Start
  4. @inputs CamPitchVel Alt [W1 W2 W3 W4]:entity Clk W BC1 BC2 BC3
  5. @outputs UnfreezePitch Cl1 Cl2 Cl3 HBrake Brakes Cltch Speed YawVel
  6. @outputs Automatic GearsSpeed:array W EStart V1 V2 V3 V4
  7. @outputs
  8. @persist Throttle E:entity HC HCount EGPEnt:entity EGPOn EGPAng EMaxCounter ECounter
  9. @persist Part:string Active Gear L R Rear LMode F RPMA SPA Space Drvs:array Alt Alarm AlarmS AlarmL
  10. @persist [Title Name URL]:string Dur Paused PlayTime Playlist:array
  11. @outputs EMaxCount ECounter ESt
  12. @trigger
  13.  
  14. if (first() | dupefinished()) {
  15.  
  16. E=entity():isWeldedTo()
  17.  
  18. #runOnKeys(owner(),1)
  19.  
  20. EGPEnt=EGP:entity()
  21. holoCreate(1)
  22. holoPos(1,E:toWorld(vec(137,0,19)))
  23. holoAng(1,E:angles())
  24. holoScale(1,vec(0.1,4,0.03))
  25.  
  26. holoCreate(2)
  27. holoPos(2,E:toWorld(vec(137,0,23)))
  28. holoAng(2,E:angles())
  29. holoScale(2,vec(0.1,4,0.03))
  30.  
  31. holoMaterial(1,"sprops/textures/sprops_chrome")
  32. holoMaterial(2,"sprops/textures/sprops_chrome")
  33.  
  34. holoCreate(3)
  35. holoModel(3,"hq_cylinder")
  36. holoPos(3,E:toWorld(vec(137,0,21)))
  37. holoAng(3,E:angles():rotateAroundAxis(E:right(),90))
  38. holoScale(3,vec(1,1,0.2))
  39. holoColor(3,vec())
  40.  
  41. holoCreate(4)
  42. holoModel(4,"hq_torus_thin")
  43. holoPos(4,E:toWorld(vec(138.5,0,21)))
  44. holoAng(4,E:angles():rotateAroundAxis(E:right(),90))
  45. holoScale(4,vec(1,1,0.2))
  46.  
  47. holoCreate(5)
  48. holoModel(5,"tetra")
  49. holoPos(5,E:toWorld(vec(138.5,0,24)))
  50. holoAng(5,E:angles():rotateAroundAxis(E:up(),180))
  51. holoScale(5,vec(0.1,0.1,0.5))
  52.  
  53. holoCreate(6)
  54. holoModel(6,"tetra")
  55. holoPos(6,E:toWorld(vec(138.5,-2.55,19.5)))
  56. holoAng(6,E:angles():rotateAroundAxis(E:up(),180):rotateAroundAxis(E:forward(),120))
  57. holoScale(6,vec(0.1,0.1,0.5))
  58.  
  59. holoCreate(7)
  60. holoModel(7,"tetra")
  61. holoPos(7,E:toWorld(vec(138.5,2.55,19.5)))
  62. holoAng(7,E:angles():rotateAroundAxis(E:up(),180):rotateAroundAxis(E:forward(),-120))
  63. holoScale(7,vec(0.1,0.1,0.5))
  64.  
  65. holoCreate(8)
  66. holoModel(8,"models/sprops/trans/lights/light_a3.mdl")
  67. holoPos(8,E:toWorld(vec(133,35,19.6)))
  68. holoAng(8,E:angles())
  69. holoScale(8,vec(3,1.5,1.5))
  70.  
  71. holoCreate(9)
  72. holoModel(9,"models/sprops/trans/lights/light_a3.mdl")
  73. holoPos(9,E:toWorld(vec(133,-35,19.6)))
  74. holoAng(9,E:angles())
  75. holoScale(9,vec(3,1.5,1.5))
  76.  
  77. holoCreate(16)
  78. holoPos(16,E:toWorld(vec(141,0,12)))
  79. holoScale(16,vec(1.5))
  80. holoAng(16,E:angles())
  81. holoModel(16,"models/sprops/trans/plates/license_2.mdl")
  82. holoSkin(16,19)
  83.  
  84. holoCreate(17)
  85. holoPos(17,E:toWorld(vec(141.22,-3.3,12)))
  86. holoScale(17,vec(0.01,1.25,0.4))
  87. holoAng(17,E:angles())
  88. }
  89.  
  90. interval(100)
  91.  
  92. if (keyClk(owner()) & owner():keyUse()) {
  93. print(E:toLocal(owner():aimEntity():pos()))
  94. }
  95.  
  96. #ifdef makeshit(vector,vector)
  97. #else
  98. function makeshit(Num,P1:vector,P2:vector) {
  99. holoCreate(Num)
  100. holoModel(Num,"models/sprops/trans/misc/coil.mdl")
  101. holoBodygroup(Num,2,4)
  102. Diff=(P1-P2)
  103. local L=Diff:length()
  104. holoPos(Num,P1-(P1-P2)/2)
  105. holoAng(Num,Diff:toAngle():rotateAroundAxis(E:forward(),90*-sign(E:toLocal(P1):y())))
  106. holoScaleUnits(Num,vec(20,20,clamp(L*5,0,70)))
  107. holoColor(Num,vec(255,0,0))
  108. #holoCreate(Num,P1-(P1-P2)/2,vec(L,30,5)/12,Diff:toAngle())
  109. #holoParent(Num,E)
  110.  
  111. }
  112. #endif
  113.  
  114. #ifdef setNumbers(string)
  115. #else
  116. function setNumbers(S:string) {
  117. for (I=1,S:length()) {
  118. Ind=S:index(I)
  119. holoCreate(I+17)
  120. holoModel(I+17,"models/sprops/misc/alphanum/alphanum_"+(Ind:lower()==Ind ? "l_" : "")+Ind:lower()+".mdl")
  121. holoPos(I+17,E:toWorld(vec(141.22,-12+4*(I-1),12)))
  122. holoColor(I+17,vec())
  123. holoScaleUnits(I+17,vec(5,1,5))#*(Ind:lower()==Ind ? 1.5 : 1)))
  124. holoAng(I+17,E:angles():rotateAroundAxis(E:up(),-90))
  125. }
  126.  
  127. }
  128. #endif
  129.  
  130.  
  131. #ifdef makePod(entity)
  132. #else
  133. function makePod(I,Pod:entity) {
  134. if (E:pos():distance(Pod:pos())>40) {return}
  135. Pod:setAlpha(0)
  136. holoCreate(I)
  137. holoPos(I,Pod:toWorld(vec(0,4,3)))
  138. holoAng(I,Pod:angles():rotateAroundAxis(Pod:right(),15))
  139. holoModel(I,"hq_rcube_thick")
  140. holoScale(I,vec(2,2,1))
  141. holoMaterial(I,"sprops/trans/misc/ls_m1")
  142.  
  143. holoCreate(I+1)
  144. holoPos(I+1,Pod:toWorld(vec(0,-5,12)))
  145. holoAng(I+1,Pod:angles():rotateAroundAxis(Pod:right(),105))
  146. holoModel(I+1,"hq_rcube_thick")
  147. holoScale(I+1,vec(2,4,0.5))
  148. holoMaterial(I+1,"sprops/trans/misc/ls_m1")
  149.  
  150. holoCreate(I+2)
  151. holoPos(I+2,Pod:toWorld(vec(0,-4.8,12)))
  152. holoAng(I+2,Pod:angles():rotateAroundAxis(Pod:right(),105))
  153. holoModel(I+2,"hq_rcube_thick")
  154. holoScale(I+2,vec(1.7,3.5,0.5))
  155. holoMaterial(I+2,"sprops/textures/sprops_wood4")
  156.  
  157. holoCreate(I+3)
  158. holoModel(I+3,"hq_cylinder")
  159. holoPos(I+3,Pod:toWorld(vec(4,-11,35)))
  160. holoScale(I+3,vec(0.1,0.1,1))
  161. holoAng(I+3,Pod:angles():rotateAroundAxis(Pod:right(),15))
  162.  
  163. holoCreate(I+4)
  164. holoModel(I+4,"hq_cylinder")
  165. holoPos(I+4,Pod:toWorld(vec(-4,-11,35)))
  166. holoScale(I+4,vec(0.1,0.1,1))
  167. holoAng(I+4,Pod:angles():rotateAroundAxis(Pod:right(),15))
  168.  
  169. holoCreate(I+5)
  170. holoModel(I+5,"models/wingf0x/hdmisocket.mdl")
  171. holoPos(I+5,Pod:toWorld(vec(0,-11,38)))
  172. holoScale(I+5,vec(3,2,2))
  173. holoAng(I+5,Pod:angles():rotateAroundAxis(Pod:up(),-90):rotateAroundAxis(Pod:right(),15))
  174.  
  175. holoCreate(I+6)
  176. holoModel(I+6,"hq_rcube_thick")
  177. holoPos(I+6,Pod:toWorld(vec(0,-10,41.3)))
  178. holoScale(I+6,vec(1.4,0.2,0.5))
  179. holoAng(I+6,Pod:angles():rotateAroundAxis(Pod:right(),15))
  180. holoMaterial(I+6,"sprops/textures/sprops_wood4")
  181.  
  182. }
  183. #endif
  184.  
  185. if (first() | clk("nextwheelcheck")) {
  186. for (I=1,6) {
  187. Wz=Wheels[I,entity]
  188. #holoCreate(I+9)
  189. LP1=E:toLocal(Wz:pos())
  190. LP2=E:toWorld(vec(LP1:x(),LP1:y()*0.6,50))
  191. makeshit(I+9,Wz:pos(),LP2 )
  192. }
  193. timer("nextwheelcheck",200)
  194. }
  195.  
  196. if (first() | dupefinished()) {
  197. setNumbers("BITCHASS")
  198.  
  199. findByClass("prop_vehicle_prisoner_pod")
  200. Ents=findToArray()
  201. for (I=1,Ents:count()) {
  202. local E=Ents[I,entity]
  203. if (E:owner()==owner()) {
  204. makePod(50+HCount*7,E)
  205. HCount++
  206. }
  207. }
  208.  
  209.  
  210.  
  211. for (I=1,100) {
  212. holoParent(I,E)
  213. }
  214. }
  215.  
  216.  
  217. #CAR CHIP
  218.  
  219.  
  220.  
  221. if (first() | dupefinished()) {
  222. runOnTick(1)
  223. Automatic=2
  224. GearsSpeed=array(30,70,120,150,180)
  225. #EGP Settings
  226.  
  227. #Other settings
  228.  
  229. Gear=0
  230. Clutch["Gear",number]=Gear
  231. HBrake=1
  232. Drvs=array(owner())
  233. Engine["Active",number]=0
  234. Tank["Active",number]=1
  235. Tank2["Active",number]=1
  236. Engine["TqAdd",number]=100
  237. Engine["MaxRpmAdd",number]=2000
  238. Engine["LimitRpmAdd",number]=2000
  239. }
  240.  
  241. Cltch=Pod["Shift",number]+HBrake
  242. Cl1=Pod["Shift",number]+BC1
  243. Cl2=Pod["Shift",number]+BC2
  244. Cl3=Pod["Shift",number]+BC3
  245. #Automatic=BtnAuto+(BtnAuto ? BtnSport : 0)
  246. #EGP
  247.  
  248. #Controls
  249.  
  250. Active=Pod["Active",number]
  251. if (Active) {
  252. L=Pod["Mouse1",number]
  253. R=Pod["Mouse2",number]
  254. S=Pod["S",number]
  255. Rear=Pod["R",number]
  256. F=Pod["Light",number]
  257. Space=Pod["Space",number]
  258. if ($Space & Space) {HBrake=!HBrake}
  259. #LightS=vec(55,0,0)*EStart+vec(200,0,0)*S
  260. #LightR=vec(255,255,255)*(Gear==6)
  261. Brakes=S*4
  262. }
  263.  
  264.  
  265. #Info
  266.  
  267.  
  268. #Starter
  269.  
  270. if (Alt & ~Alt) {
  271. if (!EStart) {
  272. soundPlay(1,0,"acf_extra/vehiclefx/starters/starter1.wav")
  273. if (Tank["Fuel",number]>1 | Tank2["Fuel",number]>1) {
  274. timer("startcar",randint(1000,1500))
  275. }
  276. } else {
  277. Engine["Active",number]=0
  278. EStart=0
  279. soundPlay(2,1,"vehicles/v8/v8_stop1.wav")
  280. }
  281. }
  282.  
  283. if (Tank["Fuel",number]<1 & Tank2["Fuel",number]<1) {
  284. EStart=0
  285. Engine["Active",number]=0
  286. }
  287.  
  288. #Alarm
  289.  
  290. if (clk("startcar") & Alt) {
  291. Engine["Active",number]=1
  292. EStart=1
  293. Engine["Throttle",number]=10011
  294. Engine["Throttle",number]=0
  295. soundPlay(2,3.35,"acf_extra/vehiclefx/starters/starter7.wav")
  296. }
  297.  
  298. if (!Alt & $Alt) {
  299. soundStop(1)
  300. }
  301.  
  302. #Rear
  303. if ($Rear & Rear) {
  304. Gear=6
  305. Clutch["Gear",number]=Gear
  306. }
  307.  
  308. #Lights
  309.  
  310.  
  311. if (EStart) {
  312. W=Pod["W",number]
  313. RPM = Engine["RPM",number]
  314. Speed=entity():vel():length()/10.936
  315. #Gearbox
  316.  
  317. if (!Automatic) {
  318. if ($L | $R) {
  319. if (Gear==6) {Gear=L} else {Gear=clamp(Gear+L-R,0,5)}
  320. #Clutch["Gear",number]=Gear
  321. }
  322. } elseif (Automatic & ($L | $R) & Gear==6) {
  323. Gear=L
  324. } elseif (Automatic & (changed(W) | changed(Space)) & W & Gear!=6) {
  325. Gear=clamp(floor(clamp(Speed,0,120)/30)+1,1,5)
  326. } elseif (Automatic & W & Gear!=6) {
  327. if (RPM>4000+Throttle*30 & Speed>GearsSpeed[Gear,number]) {
  328. Gear=clamp(Gear+1,0,5)
  329. } elseif (RPM<3000+Throttle*20 & Speed<GearsSpeed[Gear-1,number]) {
  330. Gear=clamp(Gear-1,0,5)
  331. }
  332. } elseif (Automatic & !W & Gear!=0 & Gear!=6) {
  333. Gear=0
  334. }
  335.  
  336. if (changed(Gear)) {
  337. Clutch["Gear",number]=Gear
  338. }
  339. }
  340.  
  341. #physics
  342.  
  343. if (!BC1 & EStart) {
  344. YawVel=entity():angVel():roll()
  345. if (abs(YawVel)>100 | abs(YawVel)<70 | W) {
  346. local Vel=clamp(E:velL():x()/40,0,50)
  347. local Sin=abs(sin(E:angles():roll()))
  348. V1=W1:velL():y()
  349. W1:applyForce(W1:right()*($V1*5 + V1)*Vel*Sin)
  350.  
  351. V2=W2:velL():y()
  352. W2:applyForce(W2:right()*($V2*5 + V2)*Vel*Sin)
  353.  
  354. V3=W3:velL():y()
  355. W3:applyForce(W3:right()*($V3*5 + V3)*Vel*Sin)
  356.  
  357. V4=W4:velL():y()
  358. W4:applyForce(W4:right()*($V4*5 + V4)*Vel*Sin)
  359. }
  360. }
  361.  
  362. #Throttle
  363.  
  364. if (first() | dupefinished()) {
  365. EGP:egpClear()
  366. EGP:egpBox(1,vec2(450,256),vec2(20,204))
  367.  
  368. }
  369.  
  370. UnfreezePitch=!W
  371.  
  372. if (W) {
  373. Throttle=clamp(Throttle+CamPitchVel,0,100)
  374. EGP:egpBox(2,vec2(450,356-Throttle),vec2(18,Throttle*2))
  375. EGP:egpColor(2,vec(255,0,0))
  376.  
  377. if (RPM<7250) {
  378. Engine:entity():acfThrottle(Throttle)
  379. } else {
  380. Engine:entity():acfThrottle(0)
  381. }
  382.  
  383. if (Gear==1 | Gear==6) {
  384. if (RPM<1000+Throttle*50) {
  385. D1["Clutch",number]=1
  386. D2["Clutch",number]=1
  387. D3["Clutch",number]=1
  388. } else {
  389. D1["Clutch",number]=0
  390. D2["Clutch",number]=0
  391. D3["Clutch",number]=0
  392. }
  393. }
  394. }
  395.  
  396. if (!W & EStart & Throttle) {
  397. Throttle=0
  398. EGP:egpRemove(2)
  399. Engine:entity():acfThrottle(0)
  400. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement