@name holo_builder By: Pyromaniac @persist Mode:string I MoveHolo M1 M2 Printed Wh Ww HoloCount Printed2 ZeroAng Col:vector Printed3 XR YR ZR U C Wall LS Wall2 ZM2 Dis2:array Wall3 Model:string S StartCreate Selection:string XM YM ZM [Pos1,Pos2]:vector Dis:array Yscale D Rotate Select ScaleValues:table Zscale Xscale Pause Scale Scale2 if (first()) { runOnTick(1) runOnChat(1) Selection = "cube" Mode = "gedit" hint("Instructions printed to console.",3) hint("Mode = "+Mode,3) concmd("echo \"**************************************\"") concmd("echo \" \"") concmd("echo \"Welcome to Pyromaniacs holo builder.\"") concmd("echo \"This will allow you to build holos\"") concmd("echo \"quickly and accurately, then be given a\"") concmd("echo \"generated code that will pre-build your holos.\"") concmd("echo \"Which you then can code and material\"") concmd("echo \"as you wish.\"") concmd("echo \" \"") concmd("echo \"Instructions:\"") concmd("echo \" *Doesn't need param, can use what your looking at.\"") concmd("echo \"say !mode to select mode.\"") concmd("echo \"say !reset to reload the chip without re-spawning.\"") concmd("echo \"say !po * accurately moves a holo relative to the E2 chip.\"") concmd("echo \"say !a * accurately changes a holos angles.\"") concmd("echo \"say !sc * accurately changes a holos scale.\"") concmd("echo \"say !m * changes a holos model.\"") concmd("echo \"say !s * to select a specific holo.\"") concmd("echo \"say !c * to copy the specified holo.\"") concmd("echo \"say !p to parent holo 1 to holo 2\"") concmd("echo \"say !pa * to parent everything to this holo\"") concmd("echo \"say !up * to unparent a holo\"") concmd("echo \"say !cs * to create a cell shade holo around the specifyed holo.\"") concmd("echo \"say !us to unselect all holos.\"") concmd("echo \"say !wh to change wall height. [Wall mode only]\"") concmd("echo \"say !ww to change wall width. [Wall mode only] [Wall type 2 only]\"") concmd("echo \"say !gn to get the highlighted holos number.\"") concmd("echo \"say !print to generate the code.\"") concmd("echo \"Make sure to place the chip under your holos\"") concmd("echo \"before you generate the code, else the positions\"") concmd("echo \"will be kind of far away from the chip.\"") concmd("echo \" \"") concmd("echo \"Mode: gedit\"") concmd("echo \"Mouse2 - Select holo model\"") concmd("echo \"Mouse1+Drag - Create holo\"") concmd("echo \"Mouse1+Crouch+Drag - If cube is selected, it will lock its ratio to 1:1:1\"") concmd("echo \"Use+Drag - Move holo\"") concmd("echo \"Crouch+Mouse1+Drag - Rotate holo\"") concmd("echo \"Use+Mouse1 or 2 - Move holo forward/backward\"") concmd("echo \"Crouch+Mouse2 - Delete holo\"") concmd("echo \" \"") concmd("echo \"Mode: scale\"") concmd("echo \"Use+Drag - Scale holo on X axis\"") concmd("echo \"Mouse1+Drag - Scale holo on Y axis\"") concmd("echo \"Mouse2+Drag - Scale holo on Z axis\"") concmd("echo \"Crouch+Mouse1+Drag - Scale holo\"") concmd("echo \"Crouch+Use+Drag - Move holo\"") concmd("echo \"Crouch+Use+Mouse1 or 2 - Move holo forward/backward\"") concmd("echo \" \"") concmd("echo \"Mode: move\"") concmd("echo \"Use+Drag - Move holo on X axis\"") concmd("echo \"Mouse1+Drag - Move holo on Y axis\"") concmd("echo \"Mouse2+Drag - Move holo on Z axis\"") concmd("echo \"Crouch+Use+Drag - Move holo\"") concmd("echo \"Crouch+Use+Mouse1 or 2 - Move holo forward/backward\"") concmd("echo \" \"") concmd("echo \"Mode: rotate\"") concmd("echo \"Use+Drag - Rotate Yaw\"") concmd("echo \"Mouse1+Drag - Rotate Pitch\"") concmd("echo \"Mouse2+Drag - Rotate Roll\"") concmd("echo \"Crouch+Mouse1 - Zero Angles\"") concmd("echo \" \"") concmd("echo \"Mode: wall\"") concmd("echo \"Mouse1+Drag - Create a box 60 units high, with custom width/length\"") concmd("echo \"Mouse2+Drag - Create a wall from point A to point B\"") concmd("echo \"Crouch+Mouse1+Drag - Create ceiling\"") concmd("echo \"Crouch+Mouse2 - Delete holo\"") concmd("echo \" \"") concmd("echo \"**************************************\"") Wh = 10 Ww = 3 I=1 } if (chatClk()) { if (owner():lastSaid() == "!gn" & lastSpoke() == owner()) { hint("This is holo number "+(Select ? Select : Dis:minIndex()),3) } if (owner():lastSaid() == "!reset" & lastSpoke() == owner()) { reset() } if (owner():lastSaid():explode(" ")[1,string] == "!mode" & lastSpoke() == owner()) { Mode = owner():lastSaid():explode(" ")[2,string] hint("Mode = "+Mode,3) } if (owner():lastSaid():explode(" ")[1,string] == "!wh" & owner():lastSaid():explode(" ")[2,string]:toNumber() & lastSpoke() == owner()) { Wh = owner():lastSaid():explode(" ")[2,string]:toNumber() hint("Wall height = "+Wh,3) } if (owner():lastSaid():explode(" ")[1,string] == "!ww" & owner():lastSaid():explode(" ")[2,string]:toNumber() & lastSpoke() == owner()) { Ww = owner():lastSaid():explode(" ")[2,string]:toNumber() hint("Wall width = "+Ww,3) } if (owner():lastSaid():explode(" ")[1,string] == "!p" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & holoEntity(owner():lastSaid():explode(" ")[3,string]:toNumber())) { holoParent(owner():lastSaid():explode(" ")[3,string]:toNumber(),owner():lastSaid():explode(" ")[2,string]:toNumber()) hint("Parented holo "+owner():lastSaid():explode(" ")[3,string]+" to holo "+owner():lastSaid():explode(" ")[2,string],3) if (!Printed2) { print("Note: Parented holos are temporary, it wont be generated in code.") Printed2 = 1 } } else { hint("Holo not found, use !gn to get the correct holo number.",3) } } if (owner():lastSaid():explode(" ")[1,string] == "!pa" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Dis2:minIndex())) { for (L=0,I) { holoParent(L,owner():lastSaid():explode(" ")[2,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Dis2:minIndex()) } hint("Parented holo "+(owner():lastSaid():explode(" ")[2,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Dis2:minIndex())+" to all other holos",3) if (!Printed2) { print("Note: Parented holos are temporary, it wont be generated in code.") Printed2 = 1 } } else { hint("Holo not found, use !gn to get the correct holo number.",3) } } if (owner():lastSaid():explode(" ")[1,string] == "!up" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber())) { holoUnparent(owner():lastSaid():explode(" ")[2,string]:toNumber()) hint("Unparented holo "+owner():lastSaid():explode(" ")[2,string],3) } else { hint("Holo not found, use !gn to get the correct holo number.",3) } } if (owner():lastSaid():explode(" ")[1,string] == "!c" & lastSpoke() == owner()) { if (owner():lastSaid():explode(" ")[2,string]:toNumber() & !Select) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber())) { holoCreate(I) String = holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()):model() holoModel(I,String:explode("/")[String:explode("/"):count(),string]:replace(".mdl","")) ScaleValues[toString(I),vector] = ScaleValues[owner():lastSaid():explode(" ")[2,string],vector] holoPos(I,holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()):pos()) holoAng(I,holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()):angles()) HoloCount++ I++ hint("Copyed holo "+owner():lastSaid():explode(" ")[2,string]+", named "+(I-1),3) } else { hint("Holo not found, use !gn to get the correct holo number.",3) } } elseif (!Select) { holoCreate(I) String = holoEntity(Dis2:minIndex()):model() holoModel(I,String:explode("/")[String:explode("/"):count(),string]:replace(".mdl","")) ScaleValues[toString(I),vector] = ScaleValues[toString(Dis2:minIndex()),vector] holoPos(I,holoEntity(Dis2:minIndex()):pos()) holoAng(I,holoEntity(Dis2:minIndex()):angles()) HoloCount++ I++ hint("Copyed holo "+Dis2:minIndex()+", named "+(I-1),3) } else { holoCreate(I) String = holoEntity(Select):model() holoModel(I,String:explode("/")[String:explode("/"):count(),string]:replace(".mdl","")) ScaleValues[toString(I),vector] = ScaleValues[toString(Select),vector] holoPos(I,holoEntity(Select):pos()) holoAng(I,holoEntity(Select):angles()) HoloCount++ I++ hint("Copyed holo "+Select+", named "+(I-1),3) } } if (owner():lastSaid():explode(" ")[1,string] == "!cs" & lastSpoke() == owner()) { if (!Printed2) { print("Note: Parented holos are temporary, it wont be generated in code.") Printed2 = 1 } if (!owner():lastSaid():explode(" ")[3,string]:toNumber()) { holoCreate(I) String = holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):model() holoModel(I,String:explode("/")[String:explode("/"):count(),string]:replace(".mdl","")) ScaleValues[toString(I),vector] = -ScaleValues[(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):toString(),vector]*1.15 holoPos(I,holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):pos()) holoAng(I,holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):angles()) holoParent(I,holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()) HoloCount++ I++ hint("Cell shaded holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex())+", named "+(I-1),3) } else { holoCreate(I) String = holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):model() holoModel(I,String:explode("/")[String:explode("/"):count(),string]:replace(".mdl","")) ScaleValues[toString(I),vector] = -ScaleValues[(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):toString(),vector]-owner():lastSaid():explode(" ")[3,string]:toNumber() holoPos(I,holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):pos()) holoAng(I,holoEntity(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()):angles()) holoParent(I,holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()) HoloCount++ I++ hint("Cell shaded holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex())+", named "+(I-1),3) } } if (owner():lastSaid():explode(" ")[1,string] == "!s" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Dis2:minIndex())) { holoColor(Select,Col) Select = owner():lastSaid():explode(" ")[2,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Dis2:minIndex() Col = holoEntity(Select):getColor() holoColor(Select,vec(255,0,0)) hint("Holo "+Select+" selected.",3) } else { hint("Holo not found, use !gn to get the correct holo number.",3) } } if (owner():lastSaid():explode(" ")[1,string] == "!po" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()) { holoPos(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex(),vec(entity():pos():x()+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[3,string]:toNumber() : owner():lastSaid():explode(" ")[2,string]:toNumber()),entity():pos():y()+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[4,string]:toNumber() : owner():lastSaid():explode(" ")[3,string]:toNumber()),entity():pos():z()+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[5,string]:toNumber() : owner():lastSaid():explode(" ")[4,string]:toNumber()))) hint("Moved holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()),3) } } if (owner():lastSaid():explode(" ")[1,string] == "!a" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()) { holoAng(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex(),ang((holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[3,string]:toNumber() : owner():lastSaid():explode(" ")[2,string]:toNumber()),(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[4,string]:toNumber() : owner():lastSaid():explode(" ")[3,string]:toNumber()),(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[5,string]:toNumber() : owner():lastSaid():explode(" ")[4,string]:toNumber()))) hint("Rotated holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()),3) } } if (owner():lastSaid():explode(" ")[1,string] == "!sc" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()) { ScaleValues[toString(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()),vector] = vec((holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[3,string]:toNumber() : owner():lastSaid():explode(" ")[2,string]:toNumber()),(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[4,string]:toNumber() : owner():lastSaid():explode(" ")[3,string]:toNumber()),(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[5,string]:toNumber() : owner():lastSaid():explode(" ")[4,string]:toNumber())) hint("Scaled holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) & owner():lastSaid():explode(" ")[5,string]:toNumber() ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex()),3) } } if (owner():lastSaid():explode(" ")[1,string] == "!m" & lastSpoke() == owner()) { if (holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber())) { holoModel(owner():lastSaid():explode(" ")[2,string]:toNumber(),owner():lastSaid():explode(" ")[3,string]) } else { holoModel(Select ? Select : Dis2:minIndex(),owner():lastSaid():explode(" ")[2,string]) } hint("Changed holo "+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[2,string]:toNumber() : Select ? Select : Dis2:minIndex())+"'s model to"+(holoEntity(owner():lastSaid():explode(" ")[2,string]:toNumber()) ? owner():lastSaid():explode(" ")[3,string] : owner():lastSaid():explode(" ")[2,string]),3) } if (owner():lastSaid():explode(" ")[1,string] == "!us" & lastSpoke() == owner()) { holoColor(Select,Col) Select = 0 hint("Holo unselected.",3) } } if (ops() < 5000) { if (owner():lastSaid() == "!print" & !Printed & chatClk() | S & !Printed) { if (!Printed3 & HoloCount > 10) { print("@persist T") print("if (first()) {") print("runOnTick(1)") print("T=curtime()") print("}") print("if (round(curtime()-T) == 0) {") Printed3 = 1 } if (HoloCount > 10 & S:toString():index(-1) == "0") { print("} elseif (round(curtime()-T) == "+(S/10)+") {") } if (holoEntity(S)) { print("holoCreate("+S+")") print("holoModel("+S+",\""+holoEntity(S):model():explode("/")[holoEntity(S):model():explode("/"):count(),string]:replace(".mdl","")+"\")") print("holoScale("+S+",vec("+ScaleValues[toString(S),vector]:x()+","+ScaleValues[toString(S),vector]:y()+","+ScaleValues[toString(S),vector]:z()+"))") print("holoAng("+S+",ang("+holoEntity(S):angles():pitch()+","+holoEntity(S):angles():yaw()+","+holoEntity(S):angles():roll()+"))") print("holoPos("+S+",entity():pos()+vec("+(holoEntity(S):pos():x()-entity():pos():x())+","+(holoEntity(S):pos():y()-entity():pos():y())+","+(holoEntity(S):pos():z()-entity():pos():z())+"))") } S++ if (S == I) { if (HoloCount > 10) { print("}") } Printed = 1 Printed3 = 0 S = 0 } } if (!holoEntity(I-1) & I>1 & !M1 & !M2 & !U & !C) { I-- } if (!holoEntity(Select) & Select) { holoColor(Select,Col) Select = 0 hint("Holo unselected.",3) } if (M1 | M2 | U | C) { Printed = 0 } M1 = owner():keyAttack1() M2 = owner():keyAttack2() U = owner():keyUse() C = owner():isCrouch() if (!M1 & !M2 & !U) { for (N=0,I) { Dis2[N,normal] = holoEntity(N) ? holoEntity(N):pos():distance(C ? owner():pos()+vec(0,0,30) : owner():pos()+vec(0,0,65)) : 999999 } for (N=0,I) { if (N != Dis2:minIndex() & N != Select) { holoColor(N,vec(255,255,255)) } elseif (!Select) { if (Mode == "gedit" | Mode == "move" | Mode == "scale" | Mode == "wall" | Mode == "rotate") { holoColor(N,vec(200,200,255)) } } } } else { if (Select != Dis2:minIndex()) { holoColor(Dis2:minIndex(),vec(255,255,255)) } } if (Mode == "gedit") { if ($M1 & M1 & !StartCreate & !U & !C) { StartCreate = 1 Pos1 = owner():aimPos() } if (M1 & StartCreate & !M2) { if (Selection != "cube" & Selection != "plane") { holoCreate(I) holoModel(I,Selection) if (Selection != "hqtorus2" & Selection != "plane" & Selection != "hqicosphere2" & Selection != "dome" & Selection != "dome2") { holoPos(I,Pos1+vec(0,0,Pos1:distance(owner():aimPos())/2)) } else { holoPos(I,Pos1) } ScaleValues[toString(I),vector] = vec()+Pos1:distance(owner():aimPos())/12 holoAng(I,ang(0,0,0)) } else { holoCreate(I) holoModel(I,Selection) holoAng(I,ang(0,0,0)) holoPos(I,Pos1+((owner():aimPos()-Pos1)/2)+vec(0,0,C ? Pos1:distance(owner():aimPos())/2 : (Selection == "cube" ? (Pos1:distance(owner():aimPos())/2.8) : 0))) ScaleValues[toString(I),vector] = C ? vec()+Pos1:distance(owner():aimPos())/12 : positive(Pos1-owner():aimPos()):setZ((Selection == "cube" ? Pos1:distance(owner():aimPos())/1.4 : 0))/12 } for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),100)) } } elseif (StartCreate & holoEntity(I)) { StartCreate = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("Hologram "+toString(I)+" has been created",3) I++ HoloCount++ } elseif (StartCreate) { StartCreate = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("ERROR, holo limit reached?",3) } if ($U & U & !MoveHolo) { Dis = Dis2 D = 0 MoveHolo = 1 } if (U & MoveHolo) { if (M1) { D++ } elseif (M2) { D-- } holoPos(Select ? Select : Dis:minIndex(),(C ? owner():pos()+vec(0,0,30) : owner():pos()+vec(0,0,65))+owner():eyeAngles():forward()*(Dis[Select ? Select : Dis:minIndex(),normal]+D)) } elseif (!U) { MoveHolo = 0 } if ($M2 & C & M2 & holoEntity(Select ? Select : Dis2:minIndex()) & !U) { hint("Holo "+toString(Select ? Select : Dis2:minIndex())+" deleted.",3) holoUnparent(Select ? Select : Dis2:minIndex()) holoDelete(Select ? Select : Dis2:minIndex()) HoloCount-- } if ($M2 & M2 & !C & !U & !M1) { if (Selection == "cube") { Selection = "hqicosphere2" } elseif (Selection == "hqicosphere2") { Selection = "hqcylinder2" } elseif (Selection == "hqcylinder2") { Selection = "pyramid" } elseif (Selection == "pyramid") { Selection = "hqtorus2" } elseif (Selection == "hqtorus2") { Selection = "hqcone" } elseif (Selection == "hqcone") { Selection = "plane" } elseif (Selection == "plane") { Selection = "dome" } elseif (Selection == "dome") { Selection = "dome2" } elseif (Selection == "dome2") { Selection = "cube" } hint("Selection = "+Selection,3) } if ($M1 & C & M1 & !Rotate& !U) { if (!Select) { Dis = Dis2 } Ang = holoEntity(Select ? Select : Dis:minIndex()):angles() Rotate = 1 } if (M1 & Rotate) { holoAng(Select ? Select : Dis:minIndex(),ang()) holoAng(Select ? Select : Dis:minIndex(),round(-holoEntity(Select ? Select : Dis:minIndex()):heading(owner():aimPos())+ang(90,0,0),-1)) } elseif (!M1) { Rotate = 0 } } if (Mode == "scale") { if (C & $U & U & !MoveHolo) { Dis = Dis2 D = 0 MoveHolo = 1 } if (U & MoveHolo) { if (M1) { D++ } elseif (M2) { D-- } holoPos(Select ? Select : Dis:minIndex(),(C ? owner():pos()+vec(0,0,30) : owner():pos()+vec(0,0,65))+owner():eyeAngles():forward()*(Dis[Select ? Select : Dis:minIndex(),normal]+D)) } elseif (!U) { MoveHolo = 0 } if (C & $M1 & M1 & !Xscale & !Yscale & !Zscale & !Scale & !Scale2 & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() Pos2 = ScaleValues[toString(Select ? Select : Dis:minIndex()),vector] Scale = 1 } elseif (Scale & M1) { ScaleValues[toString(Select ? Select : Dis:minIndex()),vector] = Pos2+(Pos1-owner():aimPos()):x()+(Pos1-owner():aimPos()):y()/24 } else { Scale = 0 } if ($U & U & !Xscale & !Yscale & !Zscale & !Scale & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() Pos2 = holoEntity(Select ? Select : Dis:minIndex()):pos()-holoEntity(Select ? Select : Dis:minIndex()):angles():forward()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:x()*6 Model = holoEntity(Select ? Select : Dis:minIndex()):model():explode("/")[holoEntity(Select ? Select : Dis:minIndex()):model():explode("/"):count(),string]:replace(".mdl","") Xscale = 1 } elseif (Xscale & U) { ScaleValues[toString(Select ? Select : Dis:minIndex()),vector] = ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:setX(Pos1:distance(owner():aimPos())/12) if (Model != "hqtorus2" & Model != "plane" & Model != "dome" & Model != "dome2") { holoPos(Select ? Select : Dis:minIndex(),Pos2+holoEntity(Select ? Select : Dis:minIndex()):angles():forward()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:x()*6) } } else { Xscale = 0 } if ($M1 & M1 & !Xscale & !Yscale & !Zscale & !Scale & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() Pos2 = holoEntity(Select ? Select : Dis:minIndex()):pos()-holoEntity(Select ? Select : Dis:minIndex()):angles():right()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:y()*6 Model = holoEntity(Select ? Select : Dis:minIndex()):model():explode("/")[holoEntity(Select ? Select : Dis:minIndex()):model():explode("/"):count(),string]:replace(".mdl","") Yscale = 1 } elseif (Yscale & M1) { ScaleValues[toString(Select ? Select : Dis:minIndex()),vector] = ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:setY(Pos1:distance(owner():aimPos())/12) if (Model != "hqtorus2" & Model != "plane" & Model != "dome" & Model != "dome2") { holoPos(Select ? Select : Dis:minIndex(),Pos2+holoEntity(Select ? Select : Dis:minIndex()):angles():right()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:y()*6) } } else { Yscale = 0 } if ($M2 & M2 & !Xscale & !Yscale & !Zscale & !Scale & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() Pos2 = holoEntity(Select ? Select : Dis:minIndex()):pos()-holoEntity(Select ? Select : Dis:minIndex()):angles():up()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:z()*6 Model = holoEntity(Select ? Select : Dis:minIndex()):model():explode("/")[holoEntity(Select ? Select : Dis:minIndex()):model():explode("/"):count(),string]:replace(".mdl","") Zscale = 1 } elseif (Zscale & M2) { ScaleValues[toString(Select ? Select : Dis:minIndex()),vector] = ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:setZ(Pos1:distance(owner():aimPos())/12) if (Model != "hqtorus2" & Model != "plane" & Model != "dome" & Model != "dome2") { holoPos(Select ? Select : Dis:minIndex(),Pos2+holoEntity(Select ? Select : Dis:minIndex()):angles():up()*ScaleValues[toString(Select ? Select : Dis:minIndex()),vector]:z()*6) } } else { Zscale = 0 } } if (Mode == "wall") { if ($M2 & C & M2 & holoEntity(Select ? Select : Dis2:minIndex()) & !U) { hint("Holo "+toString(Select ? Select : Dis2:minIndex())+" deleted.",3) holoUnparent(Select ? Select : Dis2:minIndex()) holoDelete(Select ? Select : Dis2:minIndex()) HoloCount-- } if (!C & $M1 & M1 & !Wall & !Wall2 & !Wall3) { Pos1 = owner():aimPos() holoCreate(I) holoModel(I,"cube") holoAng(I,ang(0,0,0)) Wall = 1 } if (M1 & Wall) { for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),100)) } holoPos(I,Pos1+((owner():aimPos()-Pos1)/2)+vec(0,0,(Wh*12)/2)) ScaleValues[toString(I),vector] = positive(Pos1-owner():aimPos()):setZ(Wh*12)/12 } elseif (Wall & holoEntity(I)) { Wall = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("Hologram "+toString(I)+" has been created",3) I++ HoloCount++ } elseif (Wall) { Wall = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("ERROR, holo limit reached?",3) } if (C & $M1 & M1 & !Wall & !Wall2 & !Wall3) { Pos1 = owner():aimPos() holoCreate(I) holoModel(I,"cube") holoAng(I,ang(0,0,0)) Wall3 = 1 } if (M1 & Wall3) { for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),100)) } holoPos(I,Pos1+((owner():aimPos()-Pos1)/2)+vec(0,0,(Wh+(Ww/2))*12)) ScaleValues[toString(I),vector] = positive(Pos1-owner():aimPos()):setZ(Ww*12)/12 } elseif (Wall3 & holoEntity(I)) { Wall3 = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("Hologram "+toString(I)+" has been created",3) I++ HoloCount++ } elseif (Wall3) { Wall3 = 0 for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("ERROR, holo limit reached?",3) } if (!C & $M2 & M2 & !Wall & !Wall2 & !Wall3) { Pos1 = owner():aimPos() holoCreate(0) holoPos(0,Pos1) holoColor(0,vec4(0,0,0,0)) holoCreate(I) holoModel(I,"cube") Wall2 = 1 } if (M2 & Wall2) { for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),100)) } Ang = ang(0,-holoEntity(0):bearing(owner():aimPos()),0) holoAng(I,ang(0,0,0)) holoAng(I,Ang) holoPos(I,Pos1+(Ang:forward()*Pos1:distance(owner():aimPos())/2)+vec(0,0,(Wh*12)/2)) ScaleValues[toString(I),vector] = vec(Pos1:distance(owner():aimPos())/12,Ww,Wh) } elseif (Wall2 & holoEntity(I)) { Wall2 = 0 holoDelete(0) for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("Hologram "+toString(I)+" has been created",3) I++ HoloCount++ } elseif (Wall2) { Wall2 = 0 holoDelete(0) for (P=0,I) { holoColor(P,vec4(holoEntity(P):getColor(),255)) } hint("ERROR, holo limit reached?",3) } } if (Mode == "move") { if (C & $U & U & !MoveHolo) { Dis = Dis2 D = 0 MoveHolo = 1 } if (U & MoveHolo) { if (M1) { D++ } elseif (M2) { D-- } holoPos(Select ? Select : Dis:minIndex(),(C ? owner():pos()+vec(0,0,30) : owner():pos()+vec(0,0,65))+owner():eyeAngles():forward()*(Dis[Select ? Select : Dis:minIndex(),normal]+D)) } elseif (!U) { MoveHolo = 0 } if ($U & U & !XM & !YM & !ZM & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = holoEntity(Select ? Select : Dis:minIndex()):pos() XM = 1 } if (U & XM) { holoPos(Select ? Select : Dis:minIndex(),Pos1:setX((owner():aimPos()):x())) } elseif (!U) { XM = 0 } if ($M1 & M1 & !XM & !YM & !ZM & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = holoEntity(Select ? Select : Dis:minIndex()):pos() YM = 1 } if (M1 & YM) { holoPos(Select ? Select : Dis:minIndex(),Pos1:setY((owner():aimPos()):y())) } elseif (!M1) { YM = 0 } if (!C & $M2 & M2 & !XM & !YM & !ZM & !MoveHolo) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() Pos2 = holoEntity(Select ? Select : Dis:minIndex()):pos() ZM = 1 } if (M2 & ZM) { holoPos(Select ? Select : Dis:minIndex(),Pos2:setZ(Pos2:z()+(Pos1-owner():aimPos()):x()+(Pos1-owner():aimPos()):y())) } elseif (!M2) { ZM = 0 } } if (Mode == "rotate") { if (C & $U & U & !XR & !YR & !ZR & !MoveHolo & !ZeroAng) { Dis = Dis2 D = 0 MoveHolo = 1 } if (U & MoveHolo) { if (M1) { D++ } elseif (M2) { D-- } holoPos(Select ? Select : Dis:minIndex(),(C ? owner():pos()+vec(0,0,30) : owner():pos()+vec(0,0,65))+owner():eyeAngles():forward()*(Dis[Select ? Select : Dis:minIndex(),normal]+D)) } elseif (!U) { MoveHolo = 0 } if ($U & U & !XR & !YR & !ZR & !MoveHolo & !ZeroAng) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() XR = 1 } if (U & XR) { holoAng(Select ? Select : Dis:minIndex(),holoEntity(Select ? Select : Dis:minIndex()):angles():setPitch((Pos1:y()-owner():aimPos():y()+Pos1:x()-owner():aimPos():x())%360)) } elseif (!U) { XR = 0 } if (!C & $M1 & M1 & !XR & !YR & !ZR & !MoveHolo & !ZeroAng) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() YR = 1 } if (M1 & YR) { holoAng(Select ? Select : Dis:minIndex(),holoEntity(Select ? Select : Dis:minIndex()):angles():setYaw((Pos1:y()-owner():aimPos():y()+Pos1:x()-owner():aimPos():x())%360)) } elseif (!M1) { YR = 0 } if ($M2 & M2 & !XR & !YR & !ZR & !MoveHolo & !ZeroAng) { if (!Select) { Dis = Dis2 } Pos1 = owner():aimPos() ZR = 1 } if (M2 & ZR) { holoAng(Select ? Select : Dis:minIndex(),holoEntity(Select ? Select : Dis:minIndex()):angles():setRoll((Pos1:y()-owner():aimPos():y()+Pos1:x()-owner():aimPos():x())%360)) } elseif (!M2) { ZR = 0 } if (C + $M1 & M1 & !XR & !YR & !ZR & !MoveHolo & !ZeroAng) { if (!Select) { Dis = Dis2 } ZeroAng = 1 } elseif (ZeroAng & M1) { holoAng(Select ? Select : Dis:minIndex(),ang(0,0,0)) } elseif (!M1) { ZeroAng = 0 } } for (N=0,I) { holoScale(N,ScaleValues[toString(N),vector]) } }