Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile("fx_default.lua")
- maxBullet=50
- Enabled=1
- function shoot2_enabled(ply,command,args)
- if ply:IsAdmin() then
- if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
- Enabled=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_enabled to "..tostring(Enabled).." \n") end
- elseif(ply:IsSuperAdmin()) then
- if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
- Enabled=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_enabled to "..tostring(Enabled).." \n") end
- else
- Msg(ply:GetName().." you're not allowed to set shoot2_enabled to "..args[1].." \n")
- end
- end
- concommand.Add("shoot2_enabled",shoot2_enabled)
- function shoot2_maxBullets(ply,command,args)
- if ply:IsAdmin() then
- if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
- maxBullet=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_maxBullets to "..tostring(maxBullet).." \n") end
- elseif(ply:IsSuperAdmin()) then
- if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
- maxBullet=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_maxBullets to "..tostring(maxBullet).." \n") end
- else
- Msg(ply:GetName().." you're not allowed to set shoot2_maxBullets to "..args[1].." \n")
- end
- end
- concommand.Add("shoot2_maxBullets",shoot2_maxBullets)
- e2function void shoot2( entity ent, vector startPos, vector dir, number spread, number force, number damage, number BulletCount, number sound, string sounds, number volume, number pitch, string tracer, number muzzle, number muzzleScale)
- if(Enabled>0) then
- local bullet = {}
- bullet.type = "shoot2"
- if(BulletCount>=maxBullet) then
- bullet.Num = maxBullet
- else
- bullet.Num = BulletCount
- end
- bullet.Src = startPos
- bullet.Dir = Vector(dir[1], dir[2], dir[3])
- bullet.Spread = Vector( spread, spread, 0 )
- bullet.Tracer = 1
- if tracer== "" then
- bullet.TracerName = "Tracer"
- else
- bullet.TracerName = tracer
- end
- bullet.Force = force
- bullet.Damage = damage
- bullet.Attacker = self.player
- if muzzle==0 then
- else
- local effectdata = EffectData()
- effectdata:SetAttachment( ent )
- effectdata:SetOrigin( startPos )
- effectdata:SetAngle( dir:Angle( ) )
- effectdata:SetScale( muzzleScale )
- util.Effect( "MuzzleEffect", effectdata )
- end
- ent:FireBullets( bullet )
- if (sound==0) then
- else
- WorldSound( sounds, startPos,volume,pitch)
- end
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement