Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function waterEffects( ply, ent )
- local waterdmg = DamageInfo()
- waterdmg:SetAttacker(nil)
- waterdmg:SetInflictor(nil)
- waterdmg:SetDamage( math.random(0.5,5) ) --A random number bettween 5 and 10
- waterdmg:SetDamageType( DMG_DROWN ) --Water damage
- for k, ply in pairs(player.GetAll()) do
- if ( ply:IsValid() and ply:WaterLevel() >= 3 ) then
- print(ply:Name().." Is under water!")
- timer.Create( "uwater_time", 25, 0, function()
- print(ply:Name().." Needs Air!")
- ply:TakeDamageInfo( waterdmg )
- util.ScreenShake( ply:GetPos(), 5 ,5 ,1.5 ,100 )
- timer.Stop( "uwater_time" )
- end)
- timer.Start( "uwater_time" )
- else
- timer.Stop( "uwater_time" )
- end
- end
- end
- hook.Add( "Think", "RealisticWaterEffects", waterEffects )
- function classControl()
- defaultTools = { "weapon_toolgun", "camera", "weapon_physgun", "weapon_gravgun" }
- for k, ply in pairs(player.GetAll()) do
- if ( ply:IsSuperAdmin() == false ) then
- if ( ply:Team() == TEAM_PET ) then
- if ( ply:GetActiveWeapon():GetClass() != "weapon_pounce" or ply:GetActiveWeapon():GetClass() != "weapon_bite" ) then
- if ( table.HasValue( defaultTools, ply:GetActiveWeapon():GetClass() ) ) then ply:GetActiveWeapon():Remove() else ply:DropWeapon( ply:GetActiveWeapon():GetClass() ) end
- end
- end
- end
- if ( ply:Team() == TEAM_CPPET ) then
- ply:SetMaterial("models/combine_soldier/combinesoldiersheet")
- else
- ply:SetMaterial("")
- end
- local tmb = 7
- if ( ply:Team() == TEAM_PET or ply:Team() == TEAM_CPPET ) then
- print(ply:Name().." Is A Pet!")
- timer.Create( "pet_health_time", 7, 0, function()
- print(ply:Name().." +1")
- ply:SetHealth(ply:Health() + 1)
- timer.Stop( "pet_health_time" )
- end)
- timer.Start( "pet_health_time" )
- else
- timer.Stop( "pet_health_time" )
- end
- end
- end
- hook.Add( "Think", "PlayerClassControl", classControl )
Advertisement
Add Comment
Please, Sign In to add comment