diff options
| -rw-r--r-- | gamemode/init.lua | 179 | ||||
| -rw-r--r-- | gamemode/utility.lua (renamed from gamemode/init_utility.lua) | 0 |
2 files changed, 1 insertions, 178 deletions
diff --git a/gamemode/init.lua b/gamemode/init.lua index 0dda971..ac34276 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -1,7 +1,4 @@ - - - -- Send clientside files AddCSLuaFile( "shared.lua" ) AddCSLuaFile( "cl_init.lua" ) @@ -39,17 +36,7 @@ local PlayerMeta = FindMetaTable( "Player" ) local EntityMeta = FindMetaTable( "Entity" ) --Tribes table -/* Moved to /server/tribes.lua -if ( !GM.Tribes ) then - GM.Tribes = GM.Tribes or {} - table.insert( GM.Tribes, { name = "The Stranded", color = Color( 200, 200, 0 ), password = false } ) - table.insert( GM.Tribes, { name = "Survivalists", color = Color( 225, 225, 225 ), password = false } ) - table.insert( GM.Tribes, { name = "Anonymous", color = Color( 0, 145, 145 ), password = false } ) - table.insert( GM.Tribes, { name = "The Gummies", color = Color( 255, 23, 0 ), password = false } ) - table.insert( GM.Tribes, { name = "The Dynamics", color = Color( 0, 72, 255 ), password = false } ) - table.insert( GM.Tribes, { name = "Scavengers", color = Color( 8, 255, 0 ), password = false } ) -end -*/ +/* Moved to /server/tribes.lua*/ GM.AntlionBarrowSpawns = {} GM.AntlionBarrowSpawns[ "gm_construct" ] = { Vector( -4321.8149, -2551.3449, 257.5130 ) } @@ -1340,170 +1327,6 @@ for k,v in pairs(GM.Plantables) do end) end -/* Refactored, see above -function GM.PlantMelon( ply, cmd, args ) - if ( ply:GetNWInt( "plants" ) >= GetConVarNumber( "gms_PlantLimit" ) ) then - ply:SendMessage( "You have hit the plant limit.", 3, Color( 200, 0, 0, 255 ) ) - return - end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - if ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) then - if ( ply:GetResource( "Melon_Seeds" ) >= 1 ) then - if ( !GMS.ClassIsNearby( tr.HitPos, "gms_seed", 30 ) and !GMS.ClassIsNearby( tr.HitPos, "prop_physics", 50 ) ) then - local data = {} - data.Pos = tr.HitPos - ply:DoProcess( "PlantMelon", 3, data ) - else - ply:SendMessage( "You need more distance between seeds/props.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You need a watermelon seed.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200, 0, 0, 255 ) ) - end -end -concommand.Add( "gms_plantmelon", GM.PlantMelon ) - -function GM.PlantBanana( ply, cmd, args ) - if ( ply:GetNWInt( "plants" ) >= GetConVarNumber( "gms_PlantLimit" ) ) then ply:SendMessage( "You have hit the plant limit.", 3, Color( 200, 0, 0, 255 ) ) return end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - if ( ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) ) then - if ( ply:GetResource( "Banana_Seeds" ) >= 1 ) then - if ( !GMS.ClassIsNearby( tr.HitPos, "gms_seed", 30 ) and !GMS.ClassIsNearby( tr.HitPos, "prop_physics", 50 ) ) then - ply:DoProcess( "PlantBanana", 3, { Pos = tr.HitPos } ) - else - ply:SendMessage( "You need more distance between seeds/props.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You need a banana seed.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200, 0, 0, 255 ) ) - end -end -concommand.Add( "gms_plantbanana", GM.PlantBanana ) - -function GM.PlantOrange( ply, cmd, args ) - if ( ply:GetNWInt( "plants" ) >= GetConVarNumber( "gms_PlantLimit" ) ) then ply:SendMessage( "You have hit the plant limit.",3,Color( 200,0,0,255 ) ) return end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - if ( ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) ) then - if ( ply:GetResource( "Orange_Seeds" ) >= 1 ) then - if ( !GMS.ClassIsNearby( tr.HitPos, "gms_seed", 30 ) and !GMS.ClassIsNearby( tr.HitPos, "prop_physics", 50 ) ) then - ply:DoProcess( "PlantOrange", 3, { Pos = tr.HitPos } ) - else - ply:SendMessage( "You need more distance between seeds/props.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You need an orange seed.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200 ,0, 0, 255 ) ) - end -end -concommand.Add( "gms_plantorange", GM.PlantOrange ) - -function GM.PlantGrain( ply, cmd, args ) - if ( !ply:HasUnlock( "Grain_Planting" ) ) then ply:SendMessage( "You need more planting skill.", 3, Color( 200, 0, 0, 255 ) ) return end - if ( ply:GetNWInt( "plants" ) >= GetConVarNumber( "gms_PlantLimit" ) ) then ply:SendMessage( "You have hit the plant limit.", 3, Color( 200, 0, 0, 255 ) ) return end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - local nearby = false - - for k, v in pairs( ents.FindInSphere( tr.HitPos, 50 ) ) do - if ( ( v:IsGrainModel() or v:IsProp() or v:GetClass() == "gms_seed" ) and ( tr.HitPos-Vector( v:LocalToWorld( v:OBBCenter() ).x, v:LocalToWorld( v:OBBCenter() ).y, tr.HitPos.z ) ):Length() <= 50 ) then - nearby = true - end - end - - if ( ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) ) then - if ( ply:GetResource( "Grain_Seeds" ) >= 1 ) then - if ( !nearby ) then - ply:DoProcess( "PlantGrain", 3, { Pos = tr.HitPos } ) - else - ply:SendMessage( "You need more distance between seeds/props.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You need a grain seed.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200, 0, 0, 255 ) ) - end -end -concommand.Add( "gms_plantgrain", GM.PlantGrain ) - -function GM.PlantBush( ply, cmd, args ) - if ( ply:GetNWInt( "plants" ) >= GetConVarNumber( "gms_PlantLimit" ) ) then ply:SendMessage( "You have hit the plant limit.", 3, Color( 200, 0, 0, 255 ) ) return end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - local nearby = false - - for k, v in pairs( ents.FindInSphere( tr.HitPos, 50 ) ) do - if ( ( v:IsBerryBushModel() or v:IsProp() or v:GetClass() == "gms_seed" ) and ( tr.HitPos-Vector( v:LocalToWorld( v:OBBCenter() ).x, v:LocalToWorld( v:OBBCenter() ).y, tr.HitPos.z ) ):Length() <= 50 ) then - nearby = true - end - end - - if ( ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) ) then - if ( ply:GetResource( "Berries" ) >= 1 ) then - if ( !nearby ) then - ply:DoProcess( "PlantBush", 3, { Pos = tr.HitPos } ) - else - ply:SendMessage( "You need more distance between seeds/props.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You need a berry.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200, 0, 0, 255 ) ) - end -end -concommand.Add( "gms_plantbush", GM.PlantBush ) - -function GM.PlantTree( ply, cmd, args ) - if ( !ply:HasUnlock( "Sprout_Planting" ) ) then ply:SendMessage( "You need more planting skill.", 3, Color( 200, 0, 0, 255 ) ) return end - local tr = ply:TraceFromEyes( 150 ) - - if ( tr.HitWorld ) then - if ( ( tr.MatType == MAT_DIRT or tr.MatType == MAT_GRASS or tr.MatType == MAT_SAND ) and !GMS.IsInWater( tr.HitPos ) ) then - if ( ply:GetResource( "Sprouts" ) >= 1 ) then - ply:DoProcess( "PlantTree", 5, { Pos = tr.HitPos } ) - else - ply:SendMessage( "You need a sprout.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "You cannot plant on this terrain.", 3, Color( 200, 0, 0, 255 ) ) - end - else - ply:SendMessage( "Aim at the ground to plant.", 3, Color( 200, 0, 0, 255 ) ) - end -end -concommand.Add( "gms_planttree", GM.PlantTree ) -*/ - function GM.DrinkFromBottle( ply, cmd, args ) if ( ply:GetResource( "Water_Bottles" ) < 1 ) then ply:SendMessage( "You need a water bottle.", 3, Color( 200, 0, 0, 255 ) ) return end ply:DoProcess( "DrinkBottle", 1.5 ) diff --git a/gamemode/init_utility.lua b/gamemode/utility.lua index 5346cdc..5346cdc 100644 --- a/gamemode/init_utility.lua +++ b/gamemode/utility.lua |
