Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( SERVER ) then
- AddCSLuaFile( "shared.lua" )
- SWEP.HoldType = "pistol"
- end
- if ( CLIENT ) then
- SWEP.PrintName = "RP Base"
- SWEP.Author = "Fixed by FuriousJack95"
- SWEP.Slot = 3
- SWEP.SlotPos = 1
- SWEP.IconLetter = "f"
- end
- SWEP.Base = "weapon_cs_base"
- SWEP.Category = "Counter-Strike"
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = false
- function SWEP:Initialize()
- self:SetWeaponHoldType( self.HoldType );
- end
- function SWEP:Holster()
- self.Weapon:SetClip1(self.Weapon:Clip1() + 1);
- return true
- end
- function SWEP:Deploy()
- self.Weapon:SetClip1(self.Weapon:Clip1() - 1);
- return true
- end
- function SWEP:Equip()
- self.Weapon:SetClip1(self.Weapon:Clip1() + 1);
- return true
- end
- function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
- draw.SimpleText( self.IconLetter, "CSSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER )
- end
- function SWEP:CSShootBullet ( dmg, recoil, numbul, cone )
- numbul = numbul or 1
- cone = cone or 0.01
- if SERVER then
- local VehHurt = self.Owner:GetEyeTrace();
- local Vehicle = VehHurt.Entity;
- if Vehicle and Vehicle:IsValid() then
- if Vehicle:IsVehicle() then
- Vehicle:GetTable().CarDamage = Vehicle:GetTable().CarDamage - (dmg * .5);
- if Vehicle:GetTable().CarDamage <= 0 then
- Vehicle:DisableVehicle();
- end
- local Driver = Vehicle:GetDriver();
- if Driver and Driver:IsValid() and Driver:IsPlayer() then
- local NewHealth = Driver:Health() - (dmg * .4);
- if NewHealth <= 0 then
- Driver:Kill();
- else
- Driver:SetHealth(NewHealth);
- Driver:GetTable().OnEnteredHealth = NewHealth;
- end
- end
- end
- end
- else
- local VehHurt = self.Owner:GetEyeTrace();
- for k, v in pairs(player.GetAll()) do
- if !v:Alive() then
- for _, ent in pairs(ents.FindInSphere(VehHurt.HitPos, 1)) do
- if ent == v:GetRagdollEntity() then
- RunConsoleCommand('perp_fpo', v:UniqueID());
- end
- end
- end
- end
- end
- local bullet = {}
- bullet.Num = numbul
- bullet.Src = self.Owner:GetShootPos() // Source
- bullet.Dir = self.Owner:GetAimVector() // Dir of bullet
- bullet.Spread = Vector( cone, cone, 0 ) // Aim Cone
- bullet.Tracer = 4 // Show a tracer on every x bullets
- bullet.Force = 5 // Amount of force to give to phys objects
- bullet.Damage = dmg
- self.Owner:FireBullets( bullet )
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) // View model animation
- self.Owner:MuzzleFlash() // Crappy muzzle light
- self.Owner:SetAnimation( PLAYER_ATTACK1 ) // 3rd Person Animation
- if ( self.Owner:IsNPC() ) then return end
- // CUSTOM RECOIL !
- if ( (SinglePlayer() && SERVER) || ( !SinglePlayer() && CLIENT && IsFirstTimePredicted() ) ) then
- local eyeang = self.Owner:EyeAngles()
- eyeang.pitch = eyeang.pitch - recoil
- self.Owner:SetEyeAngles( eyeang )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement