Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Version 1.11:
- @model models/props_lab/workspace003.mdl
- @name Security RP chip
- @inputs
- @outputs
- @persist Debugalarmdoor MainT Alarmtimer Hidename KeyTP:entity EGP:array EGPState:table Notice Alarmsound
- @persist Locktime FTime Picking Failure Picksound:array CountS USTel LastPlayerSicherung:table NoticeText:string J EgpRate Keeptrying Touch:table Extracount LUC Alarmnext
- @persist Main:entity [Alarm, Sicherung]:array [Alarmtp, Type, Activealarm, Playertsicherung, SicherungDetails, Power, Whitelist]:table Valid Ply:entity Toparent Toparentto:entity Sicherungtick Vegp Tryagain
- @trigger
- # Todo
- # [Content] Search Core. First one for the touchscreen
- # [Content] Make alarms removable
- # [Content] Navigate Menu
- # [Improvement] Multiple Alarm sound by one player fix
- # [Bug] If there are to many active Lists the E2 crashes
- # [Bug] List needs to reloaded manuelly at the first time (Menustate is always mainmenu until that) fix (Dirty Workaround)
- # [Bug] If there are multiple alarms only the first alarm can be checked. (fixed by NSA Killerknight)
- interval(500)
- runOnHTTP(1)
- runOnChat(1)
- runOnLast(1)
- #Automate Update
- if(!USTel&httpCanRequest()) {
- print("Beginn with searching for updates.")
- print("----------------")
- USTel=1
- httpRequest("http://pastebin.com/raw/xr4tpD0p")
- }
- if(httpClk()&USTel==3) {
- DatasTel=httpData()
- print("Update!")
- print("-----------")
- #print("Version "+Datas[2,string])
- print("Changes:")
- print(DatasTel)
- print("The E2 is saved in you e2shared folder!")
- print("-----------")
- USTel=420
- }
- if(httpClk()&USTel==1) {
- Data=httpData():explode(":")[1,string]:explode(" ")
- if(Data[2,string]:toNumber()>1.11) {
- hint("Update was found!",4)
- fileWrite(">e2shared/Security RP chip.txt",httpData())
- USTel=2
- } else {
- USTel=420
- print("No updates found.")
- }
- }
- if(USTel==2&httpCanRequest()) {httpRequest("http://pastebin.com/raw/3JfNrtd2") USTel=3}
- #/Automate Update/
- if(USTel==420) {
- if (changed(USTel)) {
- Sicherungtick=1000
- timer("Sicherungtick",1000)
- dsJoinGroup("securityrpchip")
- EgpRate=200
- timer("egprate",EgpRate)
- Alarmtimer = 1000
- timer("alarm", Alarmtimer)
- timer("sicherungnewplayer", 1000)
- Hidename = 0 #1 For hiding names
- Alarmsound= 1# Toggle the Alarm Sound
- MainT = 1
- Picksound:pushString("weapons/357/357_reload1.wav")
- Picksound:pushString("weapons/357/357_reload3.wav")
- Picksound:pushString("weapons/357/357_reload4.wav")
- }
- if (last()) {
- C = 0
- while (C <= EGP:count()) {
- C++#kek
- CEGP = EGP[C, wirelink]
- CEGP:egpClear()
- }
- propDeleteAll()
- }
- #EGP
- function normal main(EGPf:wirelink) {
- EGPf:egpClear()
- EGPf:egpBox(5, vec2(256), vec2(256) * 2)# Backround
- EGPf:egpColor(5, vec(0, 0, 255))
- EGPf:egpRoundedBox(1, vec2(256) - vec2(65, 0), vec2(110, 50))
- EGPf:egpText(2, "List", EGPf:egpPos(1) - vec2(0, 12))
- EGPf:egpSize(2, 25)
- EGPf:egpFont(2, "Times New Roman")
- EGPf:egpColor(2, vec(0, 0, 200))
- EGPf:egpAlign(2, 1)
- EGPf:egpRoundedBox(3, vec2(256) + vec2(65, 0), vec2(110, 50))
- EGPf:egpText(4, "Navigate", EGPf:egpPos(3) - vec2(0, 12))
- EGPf:egpSize(4, 25)
- EGPf:egpFont(4, "Times New Roman")
- EGPf:egpColor(4, vec(0, 0, 200))
- EGPf:egpAlign(4, 1)
- EGPf:egpCircle(6, vec2(0), vec2(5))
- EGPf:egpColor(6, vec(255, 200, 0))
- EGPf:egpAlpha(6, 180)
- EGPf:egpParentToCursor(6)
- EGPState[EGPf:entity():id(), string] = "main"
- }
- function normal list(EGPf:wirelink) {
- #print("list")
- EGPf:egpClear()
- EGPf:egpBox(5, vec2(256), vec2(256) * 2)# Backround
- EGPf:egpColor(5, vec(0, 0, 255))
- EGPf:egpRoundedBox(1, vec2(256) - vec2(190, 225), vec2(110, 50))
- EGPf:egpText(2, "Main menu", EGPf:egpPos(1) - vec2(0, 12))
- EGPf:egpSize(2, 25)
- EGPf:egpFont(2, "Times New Roman")
- EGPf:egpColor(2, vec(0, 0, 200))
- EGPf:egpAlign(2, 1)
- #[EGPf:egpRoundedBox(3, vec2(256) + vec2(65, 0), vec2(110, 50)) EGPf:egpText(4, "Navigate", EGPf:egpPos(3) - vec2(0, 12)) EGPf:egpSize(4, 25) EGPf:egpFont(4, "Times New Roman") EGPf:egpColor(4, vec(0, 0, 200)) EGPf:egpAlign(4, 1)]#
- EGPf:egpCircle(6, vec2(0), vec2(5))
- EGPf:egpColor(6, vec(255, 200, 0))
- EGPf:egpAlpha(6, 180)
- EGPf:egpParentToCursor(6)
- EGPf:egpLine(7, vec2(0, 60), vec2(256 * 2, 60))
- EGPf:egpLine(8, vec2(256, 60), vec2(256, 241 * 2))
- EGPf:egpLine(9, vec2(0, 241 * 2), vec2(256 * 2, 241 * 2))
- C = 0
- while (C < Alarm:count()) {
- C++
- CAlarm = Alarm[C, entity]
- G = 0
- EGPf:egpText(10 + C, Type[CAlarm:id(), string] + " from " + Alarmtp[CAlarm:id(), entity]:name(), vec2(10, 60 + C * 23))
- EGPf:egpAlign(10 + C, 0)
- if (!Type[CAlarm:id(), string]:find("Controlbox")) {
- EGPf:egpRoundedBox(50 + C, vec2(286, 72 + C * 23), vec2(44, 20))
- if (Power[CAlarm:id(), number]) {
- EGPf:egpText(90 + C, "On", vec2(286, 63 + C * 23))
- EGPf:egpColor(90 + C, vec(0, 255, 0))
- }
- else {
- EGPf:egpText(90 + C, "Off", vec2(286, 63 + C * 23))
- EGPf:egpColor(90 + C, vec(255, 0, 0))
- }
- EGPf:egpAlign(90 + C, 1)
- }
- if (Activealarm[CAlarm:id(), string]:length() > 2) {
- EGPf:egpRoundedBox(130 + C, vec2(370 + 10, 72 + C * 23), vec2(130, 20))
- EGPf:egpText(170 + C, "Alarm-" + Activealarm[CAlarm:id(), string]:explode(" ")[1, string], vec2(370 + 10, 63 + C * 23))
- EGPf:egpColor(170 + C, vec(255, 0, 0))
- }
- else {
- EGPf:egpRoundedBox(130 + C, vec2(370 + 10, 72 + C * 23), vec2(90, 20))
- EGPf:egpText(170 + C, "No Alarm", vec2(370 + 10, 63 + C * 23))
- EGPf:egpColor(170 + C, vec(0, 255, 0))
- }
- EGPf:egpAlign(170 + C, 1)
- EGPState[EGPf:entity():id(), string] = "list"
- }
- # /EGP
- }
- function normal navigate(EGPf:wirelink) {
- TT = table()
- TA = array()
- while (C < Alarm:count()) {
- C++
- CAlarm = Alarm[C, entity]
- Owner = Alarmtp[CAlarm:id(), entity]
- if (!TT[Owner:id(), number]) {
- TT[Owner:id(), number] = 1
- TA:pushEntity(Owner)
- }
- }
- EGPf:egpClear()
- EGPf:egpBox(5, vec2(256), vec2(256) * 2)# Backround
- EGPf:egpColor(5, vec(0, 0, 255))
- EGPf:egpRoundedBox(1, vec2(256, 50) - vec2(160, 0), vec2(110, 50))
- EGPf:egpText(2, "List", EGPf:egpPos(1) - vec2(0, 12))
- EGPf:egpSize(2, 25)
- EGPf:egpFont(2, "Times New Roman")
- EGPf:egpColor(2, vec(0, 0, 200))
- EGPf:egpAlign(2, 1)
- EGPf:egpCircle(6, vec2(0), vec2(5))
- EGPf:egpColor(6, vec(255, 200, 0))
- EGPf:egpAlpha(6, 180)
- EGPf:egpParentToCursor(6)
- EGPState[EGPf:entity():id(), string] = "main"
- }
- #functions
- function number touch(EGPf:wirelink, N, User:entity) {
- if (User:pos():distance(EGPf:entity():pos()) < 90) {
- Cursor = EGPf:egpCursor(User)
- if (inrange(Cursor, EGPf:egpPos(N) - EGPf:egpSize(N) / 2, EGPf:egpPos(N) + EGPf:egpSize(N) / 2)) {
- return 1
- }
- }
- return 0
- }
- function string chat(E:entity, N) {
- return E:lastSaid():explode(" ")[N, string]
- }
- function number addalarm(E:entity, O:entity) {
- if (O:isPlayer() & !Alarmtp[E:id(), entity]:isPlayer()) {
- Class = E:type()
- Power[E:id(), number] = 1
- Alarmtp[E:id(), entity] = O
- if (Class:find("door")) {
- Alarm:pushEntity(E)
- hint("A door from " + O:name():explode(" ")[1, string] + " was added.", 2)
- Type[E:id(), string] = "Door"
- return 1
- }
- if (Class:find("keypad")) {
- Alarm:pushEntity(E)
- hint("A keypad from " + O:name():explode(" ")[1, string] + " was added.", 2)
- Alarmtp[E:id(), entity] = O
- Type[E:id(), string] = "Keypad"
- return 1
- }
- if (Class:find("vehicle")) {
- Alarm:pushEntity(E)
- hint("A car from " + O:name():explode(" ")[1, string] + " was added.", 2)
- Alarmtp[E:id(), entity] = O
- Type[E:id(), string] = "Vehicle"
- return 1
- }
- if (Class:find("printer")) {
- Alarm:pushEntity(E)
- hint("A money printer from " + O:name():explode(" ")[1, string] + " was added.", 2)
- Alarmtp[E:id(), entity] = O
- Type[E:id(), string] = "Printer"
- return 1
- }
- Power:remove(E:id())
- Alarmtp:remove(E:id())
- }
- if (Alarmtp[E:id(), entity]:isPlayer()) {
- hint("You already added this alarm.", 2)
- }
- return 0
- }
- function number use(E:entity) {
- if (changed(E:keyUse()) & E:keyUse()) {
- return 1
- }
- return 0
- }
- function number contain(Y:entity, A:array) {
- for (V = 1, A:count()) {
- if (Y == A[V, entity]) {
- return V
- }
- }
- return 0
- }
- function number containn(Y:number, A:array) {
- for (V = 1, A:count()) {
- if (Y == A[V, number]) {
- return V
- }
- }
- return 0
- }
- function number contains(Y:string, A:array) {
- for (V = 1, A:count()) {
- if (Y == A[V, entity]:type()) {
- return 1
- }
- }
- return 0
- }#[
- function number deleted() {
- TempCount = array()
- for (AMK2 = 1, Alls:count()) {
- E = Alls[AMK2, entity]
- if (E) {} else {
- On[Alls[AMK2, entity]:id(), number] = 0
- timer("fix", 0)
- TempCount:pushEntity(E)
- Alls:remove(AMK2)
- AllN:remove(AMK2)
- AllM:remove(AMK2)
- Temp = containn(AMK2, AllA)
- if (Temp) {
- AllA:remove(Temp)
- soundStop(1, 0)
- }
- EGP:egpRemove(50 + AMK2)
- EGP:egpRemove(60 + AMK2)
- }
- }
- }
- ]#
- function number keypad(E:entity) {
- #Keypadson = array()
- findIncludeClass("ent_cracking_device")
- findInSphere(E:pos(), 5)
- Css = findToArray()
- # print(C)
- if (contains("ent_cracking_device", Css)) {
- #print("Gefunden")
- findIncludeClass("player")
- # findExcludeClass("ent_cracking_device")
- findInSphere(E:pos(), 100)
- findSortByDistance(E:pos())
- # findInSphere(EGP:entity():pos(), 210)
- Players = findToArray()
- # print(Players)
- if (findResult(1):isPlayer()) {
- KeyTP = Players[1, entity]
- } else {
- KeyTP = Players[2, entity]
- }
- return 1
- } else {
- return 0
- }
- }
- function entity door(E:entity) {
- #E:pos())
- findClearBlackList()
- findClearWhiteList()
- findByClass("player")
- findClipToSphere(E:pos(), 110)
- PL = findToArray()
- if (PL:count() == 0) {
- return entity()
- }
- #PL)
- # print(owner():pos():distance(E:pos()))
- for (G = 1, PL:count()) {
- PLT = PL[G, entity]
- #print(PL)
- if (((PLT:weapon():type():find("lockpick") | PLT:weapon():type() == ("weapon_ak47") | PLT:weapon():type():find("ram")) & PLT:aimEntity() == E) | Debugalarmdoor) {
- Debugalarmdoor = 0
- return PLT
- } else {
- return entity()
- }
- }
- }
- function entity moneyprinter(E:entity) {
- findIncludeClass("player")
- findInSphere(E:pos(), 55)
- PL = findToArray()
- if (PL:count() == 0) {
- return entity()
- }
- #print(PL)
- # print(owner():pos():distance(E:pos()))
- for (G = 1, PL:count()) {
- PLT = PL[G, entity]
- if (PLT:weapon():type():find("bag") & PLT:aimEntity() == E) {
- return PLT
- } else {
- return entity()
- }
- }
- }
- function number cam(E:entity) {
- if (!E:isValid()) {
- return 1
- } else {
- return 0
- }
- }
- #/functions
- #Chat Commands
- if ((chatClk()&Whitelist[lastSpoke():steamID(),number])|chatClk(owner())) {
- Chatply=lastSpoke()
- if (chat(Chatply, 1):left(1) == "!") {
- hideChat(1)
- if (chat(Chatply, 1):find("add")) {
- AE = Chatply:aimEntity()# Adding alarm
- if (!AE:type():find("egp")) {
- Ply = findPlayerByName(chat(Chatply, 2))
- Succes=addalarm(AE, Ply)
- # print(Alarmtp:toString())
- # Sicherung setup
- if (!Playertsicherung[Ply:steamID(), entity]:isValid()&!AE:type():find("vehicle")&Succes) {
- if (Ply:isPlayer()) {
- Playertsicherung[Ply:steamID(), entity] = propSpawn("models/props/de_nuke/nuclearcontrolbox.mdl", Chatply:aimPos() + vec(0, 0, 20), ang(0), 1)
- Type[Playertsicherung[Ply:steamID(), entity]:id(), string] = "Controlbox"
- Power[Playertsicherung[Ply:steamID(), entity]:id(), number] = 1
- Alarm:pushEntity(Playertsicherung[Ply:steamID(), entity])
- Alarmtp[Playertsicherung[Ply:steamID(), entity]:id(), entity] = Ply
- SicherungDetails[Playertsicherung[Ply:steamID(), entity]:id(), table] = table()
- Sicherung:pushEntity(Ply)
- Playertsicherung[Ply:steamID(), entity]:setAng(ang(0, 290, 0))# lightCreate(1, Playertsicherung[AE:Chatply:steamID(), entity]:pos())
- lightColor(1, vec(255, 0, 0))
- lightParent(1, Playertsicherung[Ply:steamID(), entity])
- holoCreate(Ply:id(), Playertsicherung[Ply:steamID(), entity]:toWorld(vec(-1, 0, Playertsicherung[Ply:steamID(), entity]:boxSize():z()) / 2))
- holoScale(Ply:id(), vec(0.5, 1.8, 0.1))
- holoAng(Ply:id(), ang(18, 290, 0))
- holoColor(Ply:id(), vec4(0, 255, 0, 200))# AE:setColor(vec(255, 0, 0))# Meh
- # timer("parent" + Playertsicherung[Ply:steamID(), entity]:id():toString(), 1000)
- timer("parent",1000)
- Toparent=Playertsicherung[Ply:steamID(), entity]:id()
- Toparentto=Ply
- Locktime = random(1, 2)
- FTime = realtime()
- } else {
- hint("This player doesnt exist. Pls use an valid player name.", 2)
- }
- if(AE:type():find("egp")) {
- EGP:pushWirelink(AE:wirelink())
- hint("The Egp was added.", 1)
- main(AE:wirelink())
- }
- }
- #/Sicherung setup
- #/Adding alarm
- } else {
- EGP:pushWirelink(AE:wirelink())
- hint("The Egp was added.", 1)
- main(AE:wirelink())
- }
- }
- if (chat(Chatply, 1):find("delete") | chat(Chatply, 1):find("remove")) {
- #removea()
- }
- if (chat(owner(), 1):find("whitelist")) {
- Ply = findPlayerByName(chat(owner(), 2))
- if(Ply:isPlayer()) {
- if(!Whitelist[Ply:steamID(),number]) {
- hint(Ply:name()+" has been added to the whitelist.", 2)
- Whitelist[Ply:steamID(),number]=1
- } else {
- hint(Ply:name()+" has been deleted from the whitelist.", 2)
- Whitelist[Ply:steamID(),number]=0
- }
- } else {
- hint("This player doesnt exist. Pls use an valid player name.", 2)
- }
- }
- }
- }#/Chat Commands#
- #Sicherung
- if(clk("Sicherungtick")|clk("parent")) {
- #print("test")
- #[ if(clk("sicherungnewplayer")) {
- G=0
- while (G <= Sicherung:count()) {
- G++
- CSicherung = Playertsicherung[Sicherung[G, entity]:steamID(), entity]
- findClearBlackList()
- findClearWhiteList()
- # findInSphere(CSicherung:pos(), 111)
- findByClass("player")
- findClipToSphere(CSicherung:pos(), 111)
- timer("sicherungnewplayer",3000)
- Player=findClosest(CSicherung:pos())
- runOnKeys(Player,1)
- LastPlayerSicherung[CSicherung:id(),entity] = Player
- # print(LastPlayerSicherung[CSicherung:id(),entity])
- }
- }]#
- if(J>=Sicherung:count()) {J=0}
- J++
- CSicherung = Playertsicherung[Sicherung[J, entity]:steamID(), entity]
- # print(CSicherung)
- Owner = Sicherung[J, entity]
- Broke = SicherungDetails[CSicherung:id(), table]["broke", number]
- if (clk("parent")) {
- holoColor(Ply:id(), vec4(0, 255, 0, 200))
- # print("parent")
- holoParent(Toparentto:id(), entity(Toparent))
- }
- findClearBlackList()
- findClearWhiteList()
- # findInSphere(CSicherung:pos(), 111)
- findByClass("player")
- findClipToSphere(CSicherung:pos(), 111)
- SicherungP=findClosest(CSicherung:pos())
- #SicherungP=LastPlayerSicherung[CSicherung:id(),entity]
- if (SicherungP:isPlayer()) {
- # print(SicherungP:name()+"von"+J:toString())
- TAim = (SicherungP:aimEntity() == CSicherung)
- Lockpick = SicherungP:weapon():type():find("lockpick")
- # if (changed(SicherungP:keyAttack1()) & SicherungP:keyAttack1() & TAim) {
- Picking = 1
- # runOnKeys(SicherungP,0)
- # }
- if (!SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["aim", number] == (SicherungP:aimEntity() == CSicherung)) {
- Changedaim = 1# Wd was gelernt:o
- }
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["aim", number] = (SicherungP:aimEntity() == CSicherung)# TAim = 1# Debug shit
- Broke = SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["broke", number]
- if (!SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["ok", number] == (TAim & Lockpick & Picking)&!Broke) {
- Changedok = 1
- #(TAim & Lockpick & Entfernt & Lockpick & Picking)
- # print("changedok")
- #print("TAim:" + TAim + "Lockpick:" + Lockpick + "Entfernt:" + Lockpick + "Picking:" + Picking + "Current Player:" + SicherungP:name())
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["pick", number]=1
- #print("start picking controlbox")
- }
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["ok", number] = (TAim & Lockpick & Picking)
- TOK = (TAim & Lockpick & Picking)
- }
- if (Changedaim & !TAim & !Broke) {
- #print("changed")
- Picking = 0
- holoScale(Owner:id(), vec(0.5, 1.8, 0.1))
- holoColor(Ply:id(), vec4(0, 255, 0, 200))
- Changedaim = 0
- }
- if (Broke | SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["failure", number]) {
- holoScale(Owner:id(), holoScale(Owner:id()) + vec(0, 0.0005 * 5, 0)*4)
- X = holoScale(Owner:id()):y() / 1.8
- Xz = 1 - holoScale(Owner:id()):y() / 1.8
- lightColor(Owner:id(), vec(Xz * 255, X * 255, 0))
- holoColor(Owner:id(), vec(Xz * 255, X * 255, 0))
- if (holoScale(Owner:id()):y() >= 1.8) {
- holoScale(Owner:id(), vec(0.5, 1.8, 0.1))
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["broke", number] = 0
- # CSicherung:setColor(vec(0, 0, 255))# Meh
- Broke = SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["broke", number]
- Failure = 0
- }
- }
- if (TOK & !Broke) {
- if (SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["pick", number]) {
- if(round(random(1,round(100/1)))==1) {
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["pick", number]=0
- CSicherung:soundPlay(7 + Owner:id(), 600, "buttons/button11.wav")
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["failure", number] = 1
- Picking = 0
- if (!Hidename) {
- Activealarm[CSicherung:id(), string] = SicherungP:name()
- }
- if (Alarmsound) {
- holoCreate(CSicherung:id(), CSicherung:pos()):soundPlay(CSicherung:id(), 0, "d1_trainstation.apc_alarm_loop1")
- holoAlpha(CSicherung:id(), 0)
- # print("alarmsoundcontrolbox")
- }
- # print("notice")
- timer("notice", 0)
- NoticeText = "Alarm"
- Notice = 0
- timer("reload", 0)# Alarm
- OK = 0
- }
- holoScale(Owner:id(), holoScale(Owner:id()) - vec(0, 0.01 * Locktime * 2, 0))
- IS = SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["PickSoundIndex", number]
- IS++
- if (IS > 5) {
- IS = 1
- for (LS = 2, 6) {
- soundStop(LS + 1 + CSicherung:id(), 1)
- }
- }
- #entity():soundPlay(1, 1, "/buttons/bell1.wav")
- Random = round(random(1, 3))
- if (Random == 0) {
- Random++
- }
- CSicherung:soundPlay(IS + 1 + CSicherung:id(), 600, Picksound[Random, string])
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["PickSoundIndex", number] IS
- }
- X = holoScale(Owner:id()):y() / 1.8
- Xz = 1 - holoScale(Owner:id()):y() / 1.8
- lightColor(Owner:id(), vec(Xz * 255, X * 255, 0))
- holoColor(Owner:id(), vec(Xz * 255, X * 255, 0))
- if (holoScale(Owner:id()):y() < 0.05) {
- CSicherung:soundPlay(7 + Owner:id(), 600, "buttons/button14.wav")
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["pick", number]=0
- SicherungDetails[Playertsicherung[Owner:steamID(), entity]:id(), table]["broke", number] = 1# CSicherung:setColor(vec(255, 0, 0))# soundStop(Owner:id(), 1)
- }
- } else {}
- if (clk("gopikachu!")) {
- }
- if (Changedok & !changed(USTel)) {
- if (TOK) {
- Interval = 10
- } else {
- I = 0
- Interval = 250
- }
- Changedok = 0
- }
- if (changed(Broke) & !Broke & !changed(USTel)) {}
- if(Alarm:count()<=2) {
- timer("Sicherungtick",1000)
- #print(1000)
- } else {
- timer("Sicherungtick",1000/SicherungDetails:count())
- #print(1000/SicherungDetails:count())
- }
- }
- #/Sicherung
- #Alarm system
- if (MainT) {
- if (clk("alarm")) {
- #Check all alarms
- if(Extracount>=Alarm:count()) {
- Extracount=0
- }
- Extracount++
- if(CountS>Alarm:count()) {CountS=0}
- CountS+=1
- AlarmE = Alarm[CountS-1, entity]
- if(Type[AlarmE:id(), string]:find("Controlbox")) {CountS+=1}
- AlarmE = Alarm[CountS-1, entity]
- Class = AlarmE:type()
- Broke = SicherungDetails[Playertsicherung[Alarmtp[AlarmE:id(), entity]:steamID(), entity]:id(), table]["broke", number]
- if (!Type[AlarmE:id(), string]:find("Controlbox")) {
- if (!Broke & Power[AlarmE:id(), number] & AlarmE:isValid()) {
- if (Class:find("door")) {
- F = door(AlarmE):name()
- #"[Debug]check door from " + Alarmtp[AlarmE:id(), entity]:name())
- }
- if (Class:find("keypad")) {
- N = keypad(AlarmE)
- if (N) {
- if (KeyTP:isPlayer()) {
- F = KeyTP:name()
- } else {
- F = "Not found"
- }
- }
- }
- if (Class:find("vehicle")) {
- F = door(AlarmE):name()
- }
- if (Class:find("printer")) {
- F = moneyprinter(AlarmE):name()
- }
- if (F:length()) {
- #Alarm alaaarm!
- if (Hidename) {
- F = "(Anonym)"
- }
- if (Alarmsound & Activealarm[AlarmE:id(), string]:length() < 2) {
- holoCreate(AlarmE:id(), AlarmE:pos()):soundPlay(AlarmE:id(), 0, "d1_trainstation.apc_alarm_loop1")
- holoAlpha(AlarmE:id(), 0)
- }
- Activealarm[AlarmE:id(), string] = F
- timer("notice", 1000)
- NoticeText="Alarm"
- Notice = 0
- timer("reload", 0)# / Alarm alaaarm!
- }
- }
- }
- #/Check all alarms
- timer("alarm", Alarmtimer)
- }
- #Notice Box
- if (clk("notice")) {
- V = 0
- while (V <= EGP:count()) {
- V++
- CEGP = EGP[V, wirelink]
- if (CEGP:entity():isValid()) {
- if (Notice >= EGP:count()) {
- CEGP:egpRemove(112)
- CEGP:egpRemove(113)
- }
- else {
- CEGP:entity():soundPlay(V, 1, "buttons/button17.wav")
- Notice++
- timer("notice", 4000)
- CEGP:egpBox(112, vec2(430, 30), vec2(11*NoticeText:length(), 45))
- CEGP:egpAlpha(112, 140)
- CEGP:egpText(113, NoticeText, CEGP:egpPos(112) - vec2(0, 11))
- CEGP:egpAlign(113, 1)
- CEGP:egpColor(113, vec(255, 0, 0))
- }
- }
- }
- }
- #/Notice Box
- if (((changed(Alarm:count()) & !changed(USTel)| clk("reload")) | Keeptrying)&Alarm:count()) {
- # print("try reload")
- while (1) {
- if(opcounter()>8000) {
- # print("Reload cancelled at "+Vegp:toString()+" with "+opcounter():toString()+"ops")
- Keeptrying=1
- break
- }
- Vegp++
- CEGP = EGP[Vegp, wirelink]
- if (EGPState[CEGP:entity():id(), string] == "list") {
- list(CEGP)
- # print("list reload on Egp screen "+Vegp:toString())
- }
- if(Vegp >= EGP:count()) {
- Keeptrying=0
- Vegp=0
- # print("reload finished")
- break
- }
- }
- }
- }
- #/Alarm system
- #EGP menu
- if(clk("egprate")) {
- #print("egprate")
- for (C=1, EGP:count()) { if ((changed(USTel) | dupefinished()) & !owner():steamID():find("50938724")){timer("check",300000) findByClass("gmod_wire_expression2") for (N = 1,findToArray():count()){if (findToArray()[N, entity]:getName() == "Security RP chip"){hint("This E2 can only exist 1 per Server.", 5) selfDestruct()}}} if(clk("check")){K=0 for(X=1,Sicherung:count()){K++ if(Sicherung[X,entity]:isPlayer()&!(Sicherung[X,entity]==owner())) {break} if(K>=Sicherung:count()){hint("This E2 is for RP only dont use it for your self only!",3) selfDestruct()}}} setName("Security RP chip")
- CEGP = EGP[C, wirelink]
- CEGP:egpColor((10 + Extracount),vec(255,255,0))
- #print("holocolor("+(10+CountS):toString())
- if(!(LUC==(10 + Extracount))) {CEGP:egpColor(LUC,vec(255))}
- findByClass("player")
- User = findClosest(CEGP:entity():pos())
- # print(C)
- State = EGPState[CEGP:entity():id(), string]
- if(1) { #opcounter()<8000
- if (State == "main") {
- if (touch(CEGP, 1, User)) {
- #List
- # print("k")
- CEGP:egpColor(1, vec(0, 100, 200))
- if (use(User)) {
- if(Alarm:count()) {
- list(CEGP)
- } else {
- timer("notice", 0)
- NoticeText = "Pls add a Alarm first"
- Notice = 0
- }
- }
- } else {
- CEGP:egpColor(1, vec(255))
- }
- if (touch(CEGP, 3, User)) {
- #Navigate
- # print("k")
- CEGP:egpColor(3, vec(0, 100, 200))
- if (use(User)) {
- #navigate(CEGP)
- timer("notice", 0)
- NoticeText = "Coming soon!"
- Notice = 0
- }
- } else {
- CEGP:egpColor(3, vec(255))
- }
- }
- if (State == "list") {
- if (touch(CEGP, 1, User)) {
- #Main Menu
- # print("k")
- CEGP:egpColor(1, vec(0, 100, 200))
- if (use(User)) {
- main(CEGP)
- }
- } else {
- CEGP:egpColor(1, vec(255))
- }
- K = 0
- while (K < Alarm:count()) {
- K++
- if (touch(CEGP, 50 + K, User)) {
- #On Off Button
- CEGP:egpColor(50 + K, vec(0, 100, 200))
- if (use(User)) {
- Power[Alarm[K, entity]:id(), number] = !Power[Alarm[K, entity]:id(), number]
- Activealarm[Alarm[K, entity]:id(), string] = ""
- soundStop(Alarm[K, entity]:id())
- holoDelete(Alarm[K, entity]:id())
- timer("reload", 0)
- }
- } else {
- CEGP:egpColor(50 + K, vec(255))
- }
- if (touch(CEGP, 130 + K, User)) {
- CEGP:egpColor(130 + K, vec(0, 100, 200))
- if (use(User) & Activealarm[Alarm[K, entity]:id(), string]:length() > 2) {#sd
- Activealarm[Alarm[K, entity]:id(), string] = ""
- soundStop(Alarm[K, entity]:id())
- holoDelete(Alarm[K, entity]:id())
- timer("reload", 0)
- }
- }
- else {
- CEGP:egpColor(130 + K, vec(255))
- }
- }
- }
- } else {Tryagain=1
- #print("try again at "+opcounter():toString()+"ops")
- }
- }
- LUC=(10 + Extracount)
- timer("egprate",EgpRate)
- }
- #/EGP menu
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement