Annoying scripting error

I am trying to make this script activate only if the game is in deathmatch mode.

here's a test script I was trying to do, but Eternity keeps crashing on me even if this script is not activated, it will start up after I erase this script entirely. How can I get the gamemode() function to work right?