Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Cloaking_Device
- @inputs Toggle Range
- @outputs Status:string
- @persist Target:entity List:array I C:entity
- # Cloaks a range of objects within a set radius
- # Only cloaks object when first activated, does NOT actively cloak per tick
- if(Toggle == 1) # If it's on
- {
- D = "Cloaking device activated."
- if(Range == 0)
- {
- soundPlay(1,0,"common/warning.wav")
- print("Error, no range defined for cloak!")
- }
- elseif(Range < 0)
- {
- soundPlay(1,0,"common/warning.wav")
- print("Range cannot be negative!")
- Range = 0
- print("Range reassigned to 0")
- }
- elseif(Range > 0)
- {
- soundPlay(1,0,"hl1/fvox/blip.wav")
- print("Cloaking range: " + Range)
- }
- if(findCanQuery())
- {
- I = 0
- if(findInSphere(entity():pos(), Range))
- {
- findSortByDistance(entity():pos())
- List = findToArray()
- print("Cloaking area.")
- while(I < List:count())
- {
- Target = List[I, entity]
- Target:setAlpha(1)
- I++
- }
- }
- }
- }
- else
- {
- Status = "Cloaking device deactivated."
- # Can only uncloak things within it's range
- # Uncloak things out of range - TODO
- if(findCanQuery())
- {
- I = 0
- findInSphere(entity():pos(), Range)
- findSortByDistance(entity():pos())
- List = findToArray()
- print("Uncloaking area.")
- print("Uncloaked: ")
- print(List)
- while(I < List:count())
- {
- Target = List[I, entity]
- Target:setAlpha(255)
- I++
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement