diff --git a/gamemode/engine/lib/server/sv_property.lua b/gamemode/engine/lib/server/sv_property.lua index 44994ee..3a09e88 100644 --- a/gamemode/engine/lib/server/sv_property.lua +++ b/gamemode/engine/lib/server/sv_property.lua @@ -38,4 +38,15 @@ function Quantum.Server.Property.Get( propid ) return Quantum.Server.Property.Pr function Quantum.Server.Property.SetOwner( propid, charid ) Quantum.Server.Property.Properties[propid].owner = charid -end \ No newline at end of file +end + +hook.Add( "Move", "Quantum_Move_Property_CheckInZone", function( ply, mv ) + if( ply.isloaded ) then + if( mv:GetVelocity() != Vector( 0, 0, 0 ) ) then + local zone = Quantum.Server.Zone.GetCurrentZone( ply:GetPos() ) + if( zone != nil ) then + ply:ChatPrint( zone.name ) + end + end + end +end) \ No newline at end of file diff --git a/gamemode/engine/lib/server/sv_zone.lua b/gamemode/engine/lib/server/sv_zone.lua index 6e53483..99a2a85 100644 --- a/gamemode/engine/lib/server/sv_zone.lua +++ b/gamemode/engine/lib/server/sv_zone.lua @@ -10,7 +10,7 @@ Quantum.Server.Zone = {} Quantum.Server.Zone.Zones = {} -- all zones are rectangles where they go from vec1 to vec2 function Quantum.Server.Zone.Register( zoneid, tbl ) - if( Quantum.Server.Zone.Zones[zoneid] != nil ) then + if( Quantum.Server.Zone.Zones[zoneid] == nil ) then local zone = { name = tbl.name || "Unknown Zone", id = zoneid, diff --git a/gamemode/init.lua b/gamemode/init.lua index c21607a..4366283 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -123,6 +123,7 @@ if SERVER then include( "settings/sv_crafting_stations_locations.lua" ) include( "settings/sh_nodes.lua" ) include( "settings/sv_nodes_locations.lua" ) + include( "settings/sv_properties.lua" ) Quantum.Server.Station.UpdateAll() end diff --git a/gamemode/settings/sv_properties.lua b/gamemode/settings/sv_properties.lua new file mode 100644 index 0000000..fe4cb03 --- /dev/null +++ b/gamemode/settings/sv_properties.lua @@ -0,0 +1,13 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +Quantum.Server.Property.Register( "house1", { + name = "Red House", + price = 10000, + vec1 = Vector( 761.43292236328, -3089.3618164063, 200.19812011719 ), + vec2 = Vector(-931.62518310547, -5161.078125, 1534.8125) +}) \ No newline at end of file