Skip to content

Commit

Permalink
Merge pull request #2829 from WilliamVenner/master
Browse files Browse the repository at this point in the history
Add lockdownStarted and lockdownEnded hooks
  • Loading branch information
FPtje committed Jan 2, 2019
2 parents b159312 + e8a6538 commit 67683db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions gamemode/modules/police/sh_interface.lua
Expand Up @@ -185,3 +185,23 @@ DarkRP.hookStub{
}
}
}

DarkRP.hookStub{
name = "lockdownStarted",
description = "When a lockdown has started.",
parameters = {},
returns = {
{
name = "actor",
description = "The player who started the lockdown",
type = "Player"
}
}
}

DarkRP.hookStub{
name = "lockdownEnded",
description = "When a lockdown has ended.",
parameters = {},
returns = {}
}
4 changes: 4 additions & 0 deletions gamemode/modules/police/sv_commands.lua
Expand Up @@ -163,6 +163,8 @@ function DarkRP.lockdown(ply)
DarkRP.printMessageAll(HUD_PRINTTALK, DarkRP.getPhrase("lockdown_started"))
SetGlobalBool("DarkRP_LockDown", true)
DarkRP.notifyAll(0, 3, DarkRP.getPhrase("lockdown_started"))
hook.Run("lockdownStarted", ply)
return ""
end
Expand All @@ -186,6 +188,8 @@ function DarkRP.unLockdown(ply)
SetGlobalBool("DarkRP_LockDown", false)
lastLockdown = CurTime()
hook.Run("lockdownEnded", ply)
return ""
end
Expand Down

0 comments on commit 67683db

Please sign in to comment.