PostKeypad Hacker E2

Posts 18 of 8 · Page 1 of 1
Keypad Hacker E2
This really doesn't deserve a new thread but there has been some high demand for it.. Simple to use. Runs at a ridiculous amount of ops though.
Not made by me.

Code:
@name Keypad Hacker
@persist Keypads:array Codes:array OwnerUse:array CO:entity Display
@trigger all
if(first()){
    entity():setColor(0,0,0,255)
    Display = 1
    CO = entity():owner()
    runOnTick(1)
    runOnChat(1)
    Scan = 1
    timer("ReScan",60000)
}
A = 1
while(A <= Keypads:count()){
    Owner = Keypads:entity(A):owner()
    Keypad = Keypads[A,entity]
    Down = OwnerUse[A,number]
    Pressed = Owner:keyUse()
    if(CO:keyAttack2() & Display & CO:shootPos():distance(Keypad:pos()) <= 100 & CO:aimEntity() == Keypad){
        Code = Codes[A,number]
        if(Code - 50000 > 0){hint("The code is: " + (Code - 50000) +". Enjoy!",5)}
        else{hint("No Code Entered. Try Again Later!",3)}
        Display = 0
    }
    elseif(!CO:keyAttack2() & !Display){Display = 1}
    if(!Down & Pressed){
        if(Keypad != noentity()){
            if(Owner:shootPos():distance(Keypad:pos()) < 32 & Owner:aimEntity() == Keypad){
                Code = Codes[A,number]
                #Find Button Pressed
                KPPL = Keypad:toLocal(Keypad:owner():aimPos()):rotate(ang())
                #Line 1
                if(inrange(KPPL:z(),-1.3,0)){
                    #Col 1
                    if(inrange(KPPL:y(),-2.2, -0.95)){Number = 1}
                    #Col 2
                    elseif(inrange(KPPL:y(),-0.6, 0.65)){Number = 2}
                    #Col 3
                    elseif(inrange(KPPL:y(),1, 2.25)){Number = 3}
                }
                #Line 2
                elseif(inrange(KPPL:z(),-2.9,-1.6)){
                    #Col 1
                    if(inrange(KPPL:y(),-2.2 ,-0.95)){Number = 4}
                    #Col 2
                    elseif(inrange(KPPL:y(),-0.6, 0.65)){Number = 5}
                    #Col 3
                    elseif(inrange(KPPL:y(),1, 2.25)){Number = 6}
                }
                #Line 3
                elseif(inrange(KPPL:z(),-4.45,-3.3)){
                    #Col 1
                    if(inrange(KPPL:y(),-2.2 ,-0.95)){Number = 7}
                    #Col 2
                    elseif(inrange(KPPL:y(),-0.6, 0.65)){Number = 8}
                    #Col 3
                    elseif(inrange(KPPL:y(),1, 2.25)){Number = 9}
                }
                elseif(inrange(KPPL:z(),0.3, 1.6)){
                    #Abort
                    if(inrange(KPPL:y(),-2.2, -0.15)){Number = 11}
                    #Accept
                    elseif(inrange(KPPL:y(),0.3, 2.25)){Number = 10}
                }
                if(Number){
                    if(Number == 10 & Code < 10000){
                            Code += 50000
                            hint("Code entered: "+(Code - 50000),3)
                    }
                    elseif(Number == 11 & Code < 10000){Code = 0 hint("Code Canceled",3)}
                    elseif(Code < 1000){
                        Code *= 10
                        Code += Number
                        hint(""+Owner:name()+" Pressed: "+Number,3)
                    }
                    Codes[A,number] = Code
                }
            }   
        }
        else{
            hint("Keypad "+A+" has been removed",3)
            Keypads:removeEntity(A)
            Codes:removeNumber(A)
        }
        OwnerUse[A, number] = 1
    }
    elseif(Down & !Pressed){
        OwnerUse[A,number] = 0
    }
A++
}

if(chatClk(entity():owner())){
    if(entity():owner():lastSaid() == "/reset"){
        A = 1
        CO = entity():owner()
        while (A <= Keypads:count()){
            Keypad = Keypads:entity(A)
            if(CO:shootPos():distance(Keypad:pos()) <= 100 & CO:aimEntity() == Keypad){
                hint("Code Reset!",3)
                Codes[A,number] = 0
            }
            A++
        }
    }
    if(CO:lastSaid() == "/scan"){
        Scan = 1
    }
}
if(clk("ReScan")){Scan = 1 timer("ReScan",60000)}
if(Scan){
    Keypads = array()
    OwnerUse = array()
    findByModel("models/props_lab/keypad.mdl")
    findSortByDistance(entity():pos())
    Keypads = findToArray()
    hint("Scan complete! "+Keypads:count()+" Keypads found!",3)
    while(Keypads:count()>13){
        hint("Keypad removed due to gate restriction!",3)
        Keypads:pop()
    }
    A = 1
    while(A <= Keypads:count()){
        print(""+A+": "+Keypads:entity(A):owner():name())
        OwnerUse[A,number] = Keypads:entity(A):owner():keyUse()
        A++
    }
    if(Keypads:count() > 0){
        timer("ReDisplayCode",3000)
    }
}
Thanks.
Might be the same that I already had.
Although - too bad it's e2.
Could you post instructions how this works? Thanks in advantage.
Just the spawn the e2. You will get popups when someone enters a correct password into a keypad. Note that the password has to be entered at least once while the e2 is running to catch the password.
So where do we put this code if it inst LUA is it CFG?
Quote Originally Posted by Ikie34 View Post
So where do we put this code if it inst LUA is it CFG?
It's an E2/Expression2. Once you have wiremod put it on data/expression2 and save it as a .txt.
Most servers require you to be ranked to use E2.
Posts 18 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?