e2 creation (wiremod)
#1
So if anyone has Wiremod expression2 I made this loading bar thing which goes down when you hold Mouse1
Since it is such a small code I figured I would share it and find out what you guys think. I made some other creations like steering, gunshops and whatnot and I figured I will try to mount this to my car to make some kind of fuel system. 
(So when the bar goes fully down the car stops running)
Code:
runOnTick(1)
if(first())
   {X = 100}
   
if(owner():keyAttack1())
   {X -=10}    
   
if(X <= 0 )
    {X = 100}
   
#1=========Indicator===============
holoCreate(1)
holoPos(1, entity():pos()+ vec(0,0,16))
holoColor(1,vec(0,115,255))
holoModel(1,"box")


#2========Base================
holoCreate(2)
holoPos(2,entity():pos()+vec(0,0,7.25))
holoScaleUnits(2,vec(3,3,0.5))


if(X==100)
   {holoScaleUnits(1,vec(2,2,17))
       holoPos(1,entity():pos()+ vec(0,0,16))}
   
if(X==90)
   {holoScaleUnits(1,vec(2,2,15.5))
       holoPos(1,entity():pos()+ vec(0,0,15))}

if(X==80)
   {holoScaleUnits(1,vec(2,2,13.5))
       holoPos(1,entity():pos()+ vec(0,0,14))}

if(X==70)
   {holoScaleUnits(1,vec(2,2,11.5))
       holoPos(1,entity():pos()+ vec(0,0,13))}
   
if(X==60)
   {holoScaleUnits(1,vec(2,2,9.5))
       holoPos(1,entity():pos()+ vec(0,0,12))}

if(X==50)
   {holoScaleUnits(1,vec(2,2,7.5))
       holoPos(1,entity():pos()+ vec(0,0,11))}
   
if(X==40)
   {holoScaleUnits(1,vec(2,2,5.5))
       holoPos(1,entity():pos()+ vec(0,0,10))}
   
if(X==30)
   {holoScaleUnits(1,vec(2,2,3.5))
       holoPos(1,entity():pos()+ vec(0,0,9))}

if(X==20)
   {holoScaleUnits(1,vec(2,2,1.5))
       holoPos(1,entity():pos()+ vec(0,0,8))}

if(X==10)
   {holoScaleUnits(1,vec(2,2,0))
       holoPos(1,entity():pos()+ vec(0,0,7.55))}
All you need to do to set it up is place a screen and wire the A of the screen to the X of the chip.

I don't know if anyone even uses wiremod because this is a RP community but I thought I might share it anyways because I thought it was pretty cool. 
[Image: h2.png]
Visit my profile here.
#2
Not the most clean code but well done Wink
The following 1 user Likes Weecow's post:
  • Haarek
#3
(06-28-2015, 10:30 AM)Weecow Wrote: Not the most clean code but well done Wink

Thanks, I am not very good with this yet. I tried adding a loop instead of repeating the same things over and over agIn but it didn't work or I couldn't figure it out.
[Image: h2.png]
Visit my profile here.


Forum Jump:


Users browsing this thread: 1 Guest(s)