From c3bec1047513b8c19eb24fef5f3230486dd17cbd Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 16 Apr 2016 22:30:18 -0400 Subject: Fixed most recepies not showing up in the structures menu --- gamemode/shared.lua | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'gamemode/shared.lua') diff --git a/gamemode/shared.lua b/gamemode/shared.lua index 77fd798..8b11b2c 100644 --- a/gamemode/shared.lua +++ b/gamemode/shared.lua @@ -6,8 +6,8 @@ READ THIS: If you want to add custom content or edit anything in gamemode - DO NOT. Please read customcontent.lua! - ÏÐÎ×ÒÈ ÝÒÎ: - Åñëè òû ñîáèðàåøüñÿ òóò ÷òî ëèáî èçìåíÿòü - ÍÅ ÄÅËÀÉ ÝÒÎÃÎ. Ïðî÷òè ôàéë customcontent.lua! + ������ ���: + ���� �� ����������� ��� ��� ���� �������� - �� ����� �����. ������ ���� customcontent.lua! */ DeriveGamemode( "sandbox" ) @@ -25,6 +25,20 @@ team.SetUp( 5, "The Dynamics", Color( 0, 72, 255, 255 ) ) team.SetUp( 6, "Scavengers", Color( 8, 255, 0, 255 ) ) GMS = GMS or {} +GM.GAMEMODE_FOLDER_NAME = "gmstranded" + +include( "utility.lua") +includeFolder("craftablesystem",true) +print("-------In shared.lua--------") +for k,v in pairs(GMS.Combinations) do + print("Recognize " .. k) + if(k == "Structures") then + for i,j in pairs(v) do + print("\tFound: " .. i) + end + end +end + include( "spp/sh_spp.lua" ) include( "time_weather.lua" ) @@ -122,7 +136,7 @@ function EntityMeta:IsTreeModel() end -- Experemental - if ( SERVER && string.find( self:GetModel(), "tree" ) && self:CreatedByMap() ) then return true end + if ( SERVER && string.find( self:GetModel(), "tree" ) && self:CreatedByMap() ) then return true end return false end @@ -141,9 +155,9 @@ function EntityMeta:IsRockModel() for k, v in pairs( GMS.AdditionalRockModels ) do if ( string.lower( v ) == mdl or string.gsub( string.lower( v ), "/", "\\" ) == mdl ) then return true end end - + -- Experemental - if ( SERVER && string.find( self:GetModel(), "rock" ) && self:CreatedByMap() ) then return true end + if ( SERVER && string.find( self:GetModel(), "rock" ) && self:CreatedByMap() ) then return true end return false end @@ -219,29 +233,29 @@ function GM:PlayerNoClip( pl, on ) end function GM:PhysgunPickup( ply, ent ) - if ( !IsValid( ent ) ) then return self.BaseClass.PhysgunPickup( self, ply, ent ) end + if ( !IsValid( ent ) ) then return self.BaseClass.PhysgunPickup( self, ply, ent ) end if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() ) then return false end - + if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end - + return self.BaseClass.PhysgunPickup( self, ply, ent ) end function GM:GravGunPunt( ply, ent ) - if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPunt( self, ply, ent ) end + if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPunt( self, ply, ent ) end if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end - + if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end - + return self.BaseClass.GravGunPunt( self, ply, ent ) end function GM:GravGunPickupAllowed( ply, ent ) - if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPickupAllowed( self, ply, ent ) end + if ( !IsValid( ent ) ) then return self.BaseClass.GravGunPickupAllowed( self, ply, ent ) end if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end - + if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end - + return self.BaseClass.GravGunPickupAllowed( self, ply, ent ) end @@ -260,8 +274,8 @@ function GM:CanTool( ply, tr, mode ) if ( table.HasValue( GMS.ProhibitedStools, mode ) && !ply:IsAdmin() ) then ply:SendMessage( "This tool is prohibited.", 3, Color( 200, 0, 0, 255 ) ) return false end local ent = tr.Entity - if ( !IsValid( ent ) && ent:GetClass() != "worldspawn" ) then return end - + if ( !IsValid( ent ) && ent:GetClass() != "worldspawn" ) then return end + if ( !SPropProtection.PhysGravGunPickup( ply, ent ) ) then return false end if ( ent:IsRockModel() || ent:IsNPC() || ent:IsTreeModel() || ent:IsPlayer() || ent:IsFoodModel() || ent:IsPickupProhibitedModel() || ent:GetClass() == "gms_buildsite" ) then return false end -- cgit v1.2.3-70-g09d2