diff options
| author | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 09:56:06 -0400 |
|---|---|---|
| committer | Bob Blackmon <bob.blackmon@ymail.com> | 2017-04-03 09:56:06 -0400 |
| commit | cc29e774fee67fda00bf004dc2eeecb997713150 (patch) | |
| tree | 7c17eb389fe5714828d5ee153632b345a796f7e4 /lua | |
| parent | 49e018aee0b82e805660e819d7b7647d8ac9c07c (diff) | |
| download | zones-cc29e774fee67fda00bf004dc2eeecb997713150.tar.gz zones-cc29e774fee67fda00bf004dc2eeecb997713150.tar.bz2 zones-cc29e774fee67fda00bf004dc2eeecb997713150.zip | |
Added OnZoneLoaded
New hook for newly loaded zones.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/zones.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/zones.lua b/lua/zones.lua index 80aaa91..ac0c9dd 100644 --- a/lua/zones.lua +++ b/lua/zones.lua @@ -1,5 +1,5 @@ -local version = 1.1 -- Older versions will not run if a newer version is used in another script. +local version = 1.11 -- Older versions will not run if a newer version is used in another script. --[[ ZONES - by Bobbleheadbob WARNING: If you edit any of these files, make them use a different namespace. Multiple scripts may depend on this library so modifying it can break other scripts. @@ -16,8 +16,9 @@ local version = 1.1 -- Older versions will not run if a newer version is used in Since multiple scripts might use the zones system, don't assume that every zone is related to your script. To register a zone class, use zones.RegisterClass(class, color); use a unique string like "Scriptname Room". When a zone class is registered, admins can use the tool to create new ones. - When a new zone is created, the "OnZoneCreated" hook is called serverside. See the hook below for documentation. - When a player edits a zone's properties, the "ShowZoneOptions" hook is called clientside. See the hook below. + When a new zone is created, the "OnZoneCreated" hook is called serverside. See the example file for documentation. + When a zone is loaded into the game, the "OnZoneLoaded" hook is called serverside. See the example file for documentation. + When a player edits a zone's properties, the "ShowZoneOptions" hook is called clientside. See the example file for documentation. Use zones.FindByClass() to find all zones which are of a given class. Use ply:GetCurrentZone() to find the zone that a player is standing in. @@ -53,6 +54,7 @@ zones.version = version zones.Classes = zones.Classes or {} zones.List = zones.List or {} + //Common interface functions: -- Registers a zone class which can then be created using weapon_zone_designator @@ -149,6 +151,8 @@ if SERVER then if not v.bounds then zones.CalcBounds(v) end + + hook.Run("OnZoneLoaded",v,v.class,k) end end |
