Mayor demotes on Death Code

I am just curious about where i would put this in the Mayor Job on DarkRP.

Here is the code for the demote on death

  1. hook.Add(“PlayerDeath”, “DemoteMayor”, function(ply) if ply:Team()==TEAM_MAYOR then ply:ChangeTeam(TEAM_CITIZEN, true) end end)

And then i have the Mayor Job code and i don’t know where to put it.

TEAM_MAYOR = AddExtraTeam(“Mayor”, Color(150, 20, 20, 255), “models/player/breen.mdl”, [[The Mayor of the city creates laws to serve the greater good
of the people.
If you are the mayor you may create and accept warrants.
Type /wanted <name> to warrant a player
Type /jailpos to set the Jail Position
Type /lockdown initiate a lockdown of the city.
Everyone must be inside during a lockdown.
The cops patrol the area
/unlockdown to end a lockdown]], {“item_ammo_pistol”}, “mayor”, 1, 85, 0, true, false/, {TEAM_CHIEF, TEAM_POLICE}/)

If anyone can help that would be great!

You put the job in the shared.lua You the on death demote part in the main.lua player death function