Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name G63
- @inputs [Wheels]:array
- @inputs [Engine Clutch EGP Pod Tank Tank2 D1 D2 D3]:wirelink Start
- @inputs CamPitchVel Alt [W1 W2 W3 W4]:entity Clk W BC1 BC2 BC3
- @outputs UnfreezePitch Cl1 Cl2 Cl3 HBrake Brakes Cltch Speed YawVel
- @outputs Automatic GearsSpeed:array W EStart V1 V2 V3 V4
- @outputs
- @persist Throttle E:entity HC HCount EGPEnt:entity EGPOn EGPAng EMaxCounter ECounter
- @persist Part:string Active Gear L R Rear LMode F RPMA SPA Space Drvs:array Alt Alarm AlarmS AlarmL
- @persist [Title Name URL]:string Dur Paused PlayTime Playlist:array
- @outputs EMaxCount ECounter ESt
- @trigger
- if (first() | dupefinished()) {
- E=entity():isWeldedTo()
- #runOnKeys(owner(),1)
- EGPEnt=EGP:entity()
- holoCreate(1)
- holoPos(1,E:toWorld(vec(137,0,19)))
- holoAng(1,E:angles())
- holoScale(1,vec(0.1,4,0.03))
- holoCreate(2)
- holoPos(2,E:toWorld(vec(137,0,23)))
- holoAng(2,E:angles())
- holoScale(2,vec(0.1,4,0.03))
- holoMaterial(1,"sprops/textures/sprops_chrome")
- holoMaterial(2,"sprops/textures/sprops_chrome")
- holoCreate(3)
- holoModel(3,"hq_cylinder")
- holoPos(3,E:toWorld(vec(137,0,21)))
- holoAng(3,E:angles():rotateAroundAxis(E:right(),90))
- holoScale(3,vec(1,1,0.2))
- holoColor(3,vec())
- holoCreate(4)
- holoModel(4,"hq_torus_thin")
- holoPos(4,E:toWorld(vec(138.5,0,21)))
- holoAng(4,E:angles():rotateAroundAxis(E:right(),90))
- holoScale(4,vec(1,1,0.2))
- holoCreate(5)
- holoModel(5,"tetra")
- holoPos(5,E:toWorld(vec(138.5,0,24)))
- holoAng(5,E:angles():rotateAroundAxis(E:up(),180))
- holoScale(5,vec(0.1,0.1,0.5))
- holoCreate(6)
- holoModel(6,"tetra")
- holoPos(6,E:toWorld(vec(138.5,-2.55,19.5)))
- holoAng(6,E:angles():rotateAroundAxis(E:up(),180):rotateAroundAxis(E:forward(),120))
- holoScale(6,vec(0.1,0.1,0.5))
- holoCreate(7)
- holoModel(7,"tetra")
- holoPos(7,E:toWorld(vec(138.5,2.55,19.5)))
- holoAng(7,E:angles():rotateAroundAxis(E:up(),180):rotateAroundAxis(E:forward(),-120))
- holoScale(7,vec(0.1,0.1,0.5))
- holoCreate(8)
- holoModel(8,"models/sprops/trans/lights/light_a3.mdl")
- holoPos(8,E:toWorld(vec(133,35,19.6)))
- holoAng(8,E:angles())
- holoScale(8,vec(3,1.5,1.5))
- holoCreate(9)
- holoModel(9,"models/sprops/trans/lights/light_a3.mdl")
- holoPos(9,E:toWorld(vec(133,-35,19.6)))
- holoAng(9,E:angles())
- holoScale(9,vec(3,1.5,1.5))
- holoCreate(16)
- holoPos(16,E:toWorld(vec(141,0,12)))
- holoScale(16,vec(1.5))
- holoAng(16,E:angles())
- holoModel(16,"models/sprops/trans/plates/license_2.mdl")
- holoSkin(16,19)
- holoCreate(17)
- holoPos(17,E:toWorld(vec(141.22,-3.3,12)))
- holoScale(17,vec(0.01,1.25,0.4))
- holoAng(17,E:angles())
- }
- interval(100)
- if (keyClk(owner()) & owner():keyUse()) {
- print(E:toLocal(owner():aimEntity():pos()))
- }
- #ifdef makeshit(vector,vector)
- #else
- function makeshit(Num,P1:vector,P2:vector) {
- holoCreate(Num)
- holoModel(Num,"models/sprops/trans/misc/coil.mdl")
- holoBodygroup(Num,2,4)
- Diff=(P1-P2)
- local L=Diff:length()
- holoPos(Num,P1-(P1-P2)/2)
- holoAng(Num,Diff:toAngle():rotateAroundAxis(E:forward(),90*-sign(E:toLocal(P1):y())))
- holoScaleUnits(Num,vec(20,20,clamp(L*5,0,70)))
- holoColor(Num,vec(255,0,0))
- #holoCreate(Num,P1-(P1-P2)/2,vec(L,30,5)/12,Diff:toAngle())
- #holoParent(Num,E)
- }
- #endif
- #ifdef setNumbers(string)
- #else
- function setNumbers(S:string) {
- for (I=1,S:length()) {
- Ind=S:index(I)
- holoCreate(I+17)
- holoModel(I+17,"models/sprops/misc/alphanum/alphanum_"+(Ind:lower()==Ind ? "l_" : "")+Ind:lower()+".mdl")
- holoPos(I+17,E:toWorld(vec(141.22,-12+4*(I-1),12)))
- holoColor(I+17,vec())
- holoScaleUnits(I+17,vec(5,1,5))#*(Ind:lower()==Ind ? 1.5 : 1)))
- holoAng(I+17,E:angles():rotateAroundAxis(E:up(),-90))
- }
- }
- #endif
- #ifdef makePod(entity)
- #else
- function makePod(I,Pod:entity) {
- if (E:pos():distance(Pod:pos())>40) {return}
- Pod:setAlpha(0)
- holoCreate(I)
- holoPos(I,Pod:toWorld(vec(0,4,3)))
- holoAng(I,Pod:angles():rotateAroundAxis(Pod:right(),15))
- holoModel(I,"hq_rcube_thick")
- holoScale(I,vec(2,2,1))
- holoMaterial(I,"sprops/trans/misc/ls_m1")
- holoCreate(I+1)
- holoPos(I+1,Pod:toWorld(vec(0,-5,12)))
- holoAng(I+1,Pod:angles():rotateAroundAxis(Pod:right(),105))
- holoModel(I+1,"hq_rcube_thick")
- holoScale(I+1,vec(2,4,0.5))
- holoMaterial(I+1,"sprops/trans/misc/ls_m1")
- holoCreate(I+2)
- holoPos(I+2,Pod:toWorld(vec(0,-4.8,12)))
- holoAng(I+2,Pod:angles():rotateAroundAxis(Pod:right(),105))
- holoModel(I+2,"hq_rcube_thick")
- holoScale(I+2,vec(1.7,3.5,0.5))
- holoMaterial(I+2,"sprops/textures/sprops_wood4")
- holoCreate(I+3)
- holoModel(I+3,"hq_cylinder")
- holoPos(I+3,Pod:toWorld(vec(4,-11,35)))
- holoScale(I+3,vec(0.1,0.1,1))
- holoAng(I+3,Pod:angles():rotateAroundAxis(Pod:right(),15))
- holoCreate(I+4)
- holoModel(I+4,"hq_cylinder")
- holoPos(I+4,Pod:toWorld(vec(-4,-11,35)))
- holoScale(I+4,vec(0.1,0.1,1))
- holoAng(I+4,Pod:angles():rotateAroundAxis(Pod:right(),15))
- holoCreate(I+5)
- holoModel(I+5,"models/wingf0x/hdmisocket.mdl")
- holoPos(I+5,Pod:toWorld(vec(0,-11,38)))
- holoScale(I+5,vec(3,2,2))
- holoAng(I+5,Pod:angles():rotateAroundAxis(Pod:up(),-90):rotateAroundAxis(Pod:right(),15))
- holoCreate(I+6)
- holoModel(I+6,"hq_rcube_thick")
- holoPos(I+6,Pod:toWorld(vec(0,-10,41.3)))
- holoScale(I+6,vec(1.4,0.2,0.5))
- holoAng(I+6,Pod:angles():rotateAroundAxis(Pod:right(),15))
- holoMaterial(I+6,"sprops/textures/sprops_wood4")
- }
- #endif
- if (first() | clk("nextwheelcheck")) {
- for (I=1,6) {
- Wz=Wheels[I,entity]
- #holoCreate(I+9)
- LP1=E:toLocal(Wz:pos())
- LP2=E:toWorld(vec(LP1:x(),LP1:y()*0.6,50))
- makeshit(I+9,Wz:pos(),LP2 )
- }
- timer("nextwheelcheck",200)
- }
- if (first() | dupefinished()) {
- setNumbers("BITCHASS")
- findByClass("prop_vehicle_prisoner_pod")
- Ents=findToArray()
- for (I=1,Ents:count()) {
- local E=Ents[I,entity]
- if (E:owner()==owner()) {
- makePod(50+HCount*7,E)
- HCount++
- }
- }
- for (I=1,100) {
- holoParent(I,E)
- }
- }
- #CAR CHIP
- if (first() | dupefinished()) {
- runOnTick(1)
- Automatic=2
- GearsSpeed=array(30,70,120,150,180)
- #EGP Settings
- #Other settings
- Gear=0
- Clutch["Gear",number]=Gear
- HBrake=1
- Drvs=array(owner())
- Engine["Active",number]=0
- Tank["Active",number]=1
- Tank2["Active",number]=1
- Engine["TqAdd",number]=100
- Engine["MaxRpmAdd",number]=2000
- Engine["LimitRpmAdd",number]=2000
- }
- Cltch=Pod["Shift",number]+HBrake
- Cl1=Pod["Shift",number]+BC1
- Cl2=Pod["Shift",number]+BC2
- Cl3=Pod["Shift",number]+BC3
- #Automatic=BtnAuto+(BtnAuto ? BtnSport : 0)
- #EGP
- #Controls
- Active=Pod["Active",number]
- if (Active) {
- L=Pod["Mouse1",number]
- R=Pod["Mouse2",number]
- S=Pod["S",number]
- Rear=Pod["R",number]
- F=Pod["Light",number]
- Space=Pod["Space",number]
- if ($Space & Space) {HBrake=!HBrake}
- #LightS=vec(55,0,0)*EStart+vec(200,0,0)*S
- #LightR=vec(255,255,255)*(Gear==6)
- Brakes=S*4
- }
- #Info
- #Starter
- if (Alt & ~Alt) {
- if (!EStart) {
- soundPlay(1,0,"acf_extra/vehiclefx/starters/starter1.wav")
- if (Tank["Fuel",number]>1 | Tank2["Fuel",number]>1) {
- timer("startcar",randint(1000,1500))
- }
- } else {
- Engine["Active",number]=0
- EStart=0
- soundPlay(2,1,"vehicles/v8/v8_stop1.wav")
- }
- }
- if (Tank["Fuel",number]<1 & Tank2["Fuel",number]<1) {
- EStart=0
- Engine["Active",number]=0
- }
- #Alarm
- if (clk("startcar") & Alt) {
- Engine["Active",number]=1
- EStart=1
- Engine["Throttle",number]=10011
- Engine["Throttle",number]=0
- soundPlay(2,3.35,"acf_extra/vehiclefx/starters/starter7.wav")
- }
- if (!Alt & $Alt) {
- soundStop(1)
- }
- #Rear
- if ($Rear & Rear) {
- Gear=6
- Clutch["Gear",number]=Gear
- }
- #Lights
- if (EStart) {
- W=Pod["W",number]
- RPM = Engine["RPM",number]
- Speed=entity():vel():length()/10.936
- #Gearbox
- if (!Automatic) {
- if ($L | $R) {
- if (Gear==6) {Gear=L} else {Gear=clamp(Gear+L-R,0,5)}
- #Clutch["Gear",number]=Gear
- }
- } elseif (Automatic & ($L | $R) & Gear==6) {
- Gear=L
- } elseif (Automatic & (changed(W) | changed(Space)) & W & Gear!=6) {
- Gear=clamp(floor(clamp(Speed,0,120)/30)+1,1,5)
- } elseif (Automatic & W & Gear!=6) {
- if (RPM>4000+Throttle*30 & Speed>GearsSpeed[Gear,number]) {
- Gear=clamp(Gear+1,0,5)
- } elseif (RPM<3000+Throttle*20 & Speed<GearsSpeed[Gear-1,number]) {
- Gear=clamp(Gear-1,0,5)
- }
- } elseif (Automatic & !W & Gear!=0 & Gear!=6) {
- Gear=0
- }
- if (changed(Gear)) {
- Clutch["Gear",number]=Gear
- }
- }
- #physics
- if (!BC1 & EStart) {
- YawVel=entity():angVel():roll()
- if (abs(YawVel)>100 | abs(YawVel)<70 | W) {
- local Vel=clamp(E:velL():x()/40,0,50)
- local Sin=abs(sin(E:angles():roll()))
- V1=W1:velL():y()
- W1:applyForce(W1:right()*($V1*5 + V1)*Vel*Sin)
- V2=W2:velL():y()
- W2:applyForce(W2:right()*($V2*5 + V2)*Vel*Sin)
- V3=W3:velL():y()
- W3:applyForce(W3:right()*($V3*5 + V3)*Vel*Sin)
- V4=W4:velL():y()
- W4:applyForce(W4:right()*($V4*5 + V4)*Vel*Sin)
- }
- }
- #Throttle
- if (first() | dupefinished()) {
- EGP:egpClear()
- EGP:egpBox(1,vec2(450,256),vec2(20,204))
- }
- UnfreezePitch=!W
- if (W) {
- Throttle=clamp(Throttle+CamPitchVel,0,100)
- EGP:egpBox(2,vec2(450,356-Throttle),vec2(18,Throttle*2))
- EGP:egpColor(2,vec(255,0,0))
- if (RPM<7250) {
- Engine:entity():acfThrottle(Throttle)
- } else {
- Engine:entity():acfThrottle(0)
- }
- if (Gear==1 | Gear==6) {
- if (RPM<1000+Throttle*50) {
- D1["Clutch",number]=1
- D2["Clutch",number]=1
- D3["Clutch",number]=1
- } else {
- D1["Clutch",number]=0
- D2["Clutch",number]=0
- D3["Clutch",number]=0
- }
- }
- }
- if (!W & EStart & Throttle) {
- Throttle=0
- EGP:egpRemove(2)
- Engine:entity():acfThrottle(0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement