PHP-Code:
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
SWEP.HoldType = "pistol"
end
if ( CLIENT ) then
SWEP.PrintName = "Test"
SWEP.Author = ""
SWEP.Category = "Sasha-Sexyfur"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.DrawAmmo =true
SWEP.DrawCrosshair =false
SWEP.IconLetter = "f"
SWEP.ViewModelFOV = 65
killicon.AddFont( "weapon_deagle", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
end
function getFiresUnderwater()
return true;
end
SWEP.Base = "weapon_cs_base"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_pist_fiveseven.mdl"
SWEP.WorldModel = "models/weapons/w_pist_fiveseven.mdl"
SWEP.Weight = 2.5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound( "Weapon_fiveseven.Single" )
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage = 14
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0
SWEP.Primary.ClipSize = 7
SWEP.Primary.Delay = 0.7
SWEP.Primary.DefaultClip = 7
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "pistol"
function SWEP:PrimaryAttack()
local trace = self.Owner:GetEyeTrace()
local ex = ents.Create ("env_explosion")
ex:SetOwner(self.Owner)
ex:SetPhysicsAttacker(self.Owner)
ex:SetPos (trace.HitPos)
ex:SetKeyValue ("iMagnitude", 14)
ex:SetKeyValue ("iRadiusOverride", 14)
ex:Fire ("explode", 0)
ex:Fire ("kill", 5)
end
function SWEP:GetViewModelPosition( vec, pos )
local myvec = vec
local mypos = pos
end
Es muss nichts in die Felder eingesetzt werden...
vec und pos geben dir die Position und Achsenstellung der SWEP wieder.