Answer:
Idk the language of code but here is how it would be done in python
myAlarm():
arm = True
code = "secret message"
myAlarm()
main():
deactivate = input(">>> ")
if deactivate = myAlarm.code:
arm = False
Im still a little confused on the question.
(I am a game designer and I code daily)