diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-22 15:30:54 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-22 15:30:54 -0400 |
| commit | e84d85263c6ef55af98cb213c5462107a0170506 (patch) | |
| tree | af6e8e48478734a6d270ebdde9c587023dae3664 /gamemode/init.lua | |
| parent | 83e1d1f833f036e0c7bc205bc2d39f0e9f083f54 (diff) | |
| download | gmstranded-e84d85263c6ef55af98cb213c5462107a0170506.tar.gz gmstranded-e84d85263c6ef55af98cb213c5462107a0170506.tar.bz2 gmstranded-e84d85263c6ef55af98cb213c5462107a0170506.zip | |
Since the new item system, the old way of createing camp fires will no longer work
Diffstat (limited to 'gamemode/init.lua')
| -rw-r--r-- | gamemode/init.lua | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/gamemode/init.lua b/gamemode/init.lua index 85d2a56..48acecd 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -65,47 +65,47 @@ util.AddNetworkString('removeEntity') util.AddNetworkString('giveres') net.Receive('removeEntity', function(len, ply) - + local ent = net.ReadEntity() if (ent:GetClass() == "gms_generic_plantable") then ply:SetNWInt( "plants", ply:GetNWInt( "plants" ) - 1 ) end if ent.IsPlantChild then - + local plant = ent.PlantParent if (plant.Children <= 1) then plant:Fadeout() end end ent:Remove() - + end) net.Receive('giveres', function(len, ply) - + local target = net.ReadEntity() local r = net.ReadString() local a = net.ReadInt(32) - + target:IncResource( r, a ) - + end) net.Receive('adminCMenuResRequest', function(len, ply) - + local target = net.ReadEntity() net.Start( 'adminCMenuResSend' ) net.WriteTable( target.Resources ) net.Send( ply ) - - + + end) net.Receive('adminCMenuSkillRequest', function(len, ply) - + local target = net.ReadEntity() net.Start( 'adminCMenuSkillSend' ) net.WriteTable( target.Skills ) net.Send( ply ) - - + + end) -- Give player weapons from grave @@ -952,37 +952,6 @@ function GM.PlayerStuck( ply, cmd, args ) end concommand.Add( "gms_stuck", GM.PlayerStuck ) -function GM.MakeCampfire( ply, cmd, args ) - if ( GetConVarNumber( "gms_campfire" ) == 1 ) then - local tr = ply:TraceFromEyes( 150 ) - - if ( !tr.HitNonWorld or !tr.Entity ) then ply:SendMessage( "Aim at the prop( s ) to use for campfire.", 3, Color( 255, 255, 255, 255 ) ) return end - - local ent = tr.Entity - local cls = tr.Entity:GetClass() - - if ( ent:IsOnFire() or cls != "prop_physics" and cls != "prop_physics_multiplayer" and cls != "prop_dynamic" ) then - ply:SendMessage( "Aim at the prop( s ) to use for campfire.", 3, Color( 255, 255, 255, 255 ) ) - return - end - - local mat = tr.MatType - - if ( ply:GetResource( "Wood" ) < 5 ) then ply:SendMessage( "You need at least 5 wood to make a fire.", 5, Color( 255, 255, 255, 255 ) ) return end - - if ( mat != MAT_WOOD ) then ply:SendMessage( "Prop has to be wood, or if partially wood, aim at the wooden part.", 5, Color( 255, 255, 255, 255 ) ) return end - - local data = {} - data.Entity = ent - - if ( SPropProtection.PlayerCanTouch( ply, ent ) ) then - ply:DoProcess( "Campfire", 5, data ) - return - end - end -end -concommand.Add( "gms_makefire", GM.MakeCampfire ) - /* ---------------------------------------------------------------------------------------------------- Player spawn ---------------------------------------------------------------------------------------------------- */ |
