Hello,
I have DarkRP installed on my dedicated server. Often it is quite annoying to have to change battons ie. Having to change to the Arrest Baton to arrest someone then vice versa to unarrest them. Would it be possible for someone to combine these two battons, so that you have to left click to arrest and right click to unarrest? What about giving the player the ability to also use the stunstick with the same weapon. Like CSS weapons when you hold E + Mouse 1 or 2 to change the weapon from semi-auto to full auto, but in this case of the baton you can change between the arresting tools, and the stunstick.
So what I am asking for is someone to combine the arrest baton with the unarrest baton, then add the function where the player holds E+ Mouse 1 or 2 to change to regular stunstick.
Thanks in advanced for any help!
Are you really so lazy that you can't just switch between the batons?
Yes
It is hardly a problem to switch unless you are an abusive cop that keeps arresting and unarresting. If so, you are one of the reasons why DarkRP has a bad reputation.
Your second post just bothers me since posting saying "Yes" with no backup as to WHY you won't just switch between the two batons just makes you sound foolish.
Since I don't want to sound like I'm flaming, I will try making this weapon.
Okay to clarify my "yes" post, I simply meant that because I and many others I'm sure, would find it a lot easier if these arrest functions were in one SWEP not three. Surely you can understand that. That you for trying to make this weapon.
Here is a solution, take your keyboard stick in in your ass and when you want to arrest you try to fart and when unarrest you try to poop... Pretty simple huh?
[highlight](User was banned for this post ("This reply is not helpful" - verynicelady))[/highlight]
[QUOTE=Pawspov;26196500]Here is a solution, take your keyboard stick in in your ass and when you want to arrest you try to fart and when unarrest you try to poop... Pretty simple huh?[/QUOTE]
No.
[QUOTE=Kaleb;26211697]No.[/QUOTE]
Comeon it hurts for the first time but its really easy to switch weapons with. Also if you like this method you can also stick mouse in your pee hole and you know the rest.
-bump-
Oh god dont bump stupidness noone will make this anyways.
im not sure a swep would be able to hold them both. Like when sum1 tried to make A pickpocket and lockpick swep it went south and only had the pickpocket function. This would be very similar, thats too much for one swep. Besides, the scroll on your mouse does tend to come in handy for quick changing sweps.
[lua]
if SERVER then
AddCSLuaFile("shared.lua")
end
if CLIENT then
SWEP.PrintName = "Arrest/Unarrest Baton"
SWEP.Slot = 1
SWEP.SlotPos = 3
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
end
SWEP.Author = "Rick Darkaliono, philxyz"
SWEP.Instructions = "Left click to arrest, Right click to unarrest"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.AnimPrefix = "stunstick"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.NextStrike = 0
SWEP.ViewModel = Model("models/weapons/v_stunstick.mdl")
SWEP.WorldModel = Model("models/weapons/w_stunbaton.mdl")
SWEP.Sound = Sound("weapons/stunstick/stunstick_swing1.wav")
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = ""
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
function SWEP:Initialize()
if SERVER then self:SetWeaponHoldType("normal") end
end
function SWEP:PrimaryAttack()
if CurTime() < self.NextStrike then return end
if SERVER then
self:SetWeaponHoldType("melee")
timer.Simple(0.3, function(wep) if wep:IsValid() then wep:SetWeaponHoldType("normal") end end, self)
end
self.Owner:SetAnimation(PLAYER_ATTACK1)
self.Weapon:EmitSound(self.Sound)
self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
self.NextStrike = CurTime() + .4
if CLIENT then return end
local trace = self.Owner:GetEyeTrace()
if trace.Entity:GetClass() == "prop_ragdoll" then
for k,v in pairs(player.GetAll()) do
if trace.Entity.OwnerINT and trace.Entity.OwnerINT == v:EntIndex() then
KnockoutToggle(v, true)
return
end
end
end
if not ValidEntity(trace.Entity) or (self.Owner:EyePos():Distance(trace.Entity:GetPos()) > 115) or (not trace.Entity:IsPlayer() and not trace.Entity:IsNPC()) then
return
end
if CfgVars["needwantedforarrest"] == 1 and not trace.Entity:IsNPC() and not trace.Entity:GetNWBool("wanted") then
Notify(self.Owner, 1, 5, "The player must be wanted in order to be able to arrest them.")
return
end
local jpc = DB.CountJailPos()
if not jpc or jpc == 0 then
Notify(self.Owner, 1, 4, "You cannot arrest people since there are no jail positions set!")
else
-- Send NPCs to Jail
if trace.Entity:IsNPC() then
trace.Entity:SetPos(DB.RetrieveJailPos())
else
if not trace.Entity.Babygod then
trace.Entity:Arrest()
Notify(trace.Entity, 1, 4, "You've been arrested by " .. self.Owner:Nick())
else
Notify(self.Owner, 1, 4, "You can't arrest players who are spawning.")
end
end
end
end
function SWEP:SecondaryAttack()
if CurTime() < self.NextStrike then return end
if SERVER then
self:SetWeaponHoldType("melee")
timer.Simple(0.3, function(wep) if wep:IsValid() then wep:SetWeaponHoldType("normal") end end, self)
end
self.Owner:SetAnimation(PLAYER_ATTACK1)
self.Weapon:EmitSound(self.Sound)
self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
self.NextStrike = CurTime() + .4
if CLIENT then return end
local trace = self.Owner:GetEyeTrace()
if not ValidEntity(trace.Entity) or not trace.Entity:IsPlayer() or (self.Owner:EyePos():Distance(trace.Entity:GetPos()) > 115) or not trace.Entity:GetNWBool("Arrested") then
return
end
trace.Entity:Unarrest()
Notify(trace.Entity, 1, 4, "You were unarrested by " .. self.Owner:Nick())
end
[/lua]
Ill be damed...
[QUOTE=Kaleb;26296201][lua]
if SERVER then
AddCSLuaFile("shared.lua")
end
if CLIENT then
SWEP.PrintName = "Arrest/Unarrest Baton"
SWEP.Slot = 1
SWEP.SlotPos = 3
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
end
SWEP.Author = "Rick Darkaliono, philxyz"
SWEP.Instructions = "Left click to arrest, Right click to unarrest"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.AnimPrefix = "stunstick"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.NextStrike = 0
SWEP.ViewModel = Model("models/weapons/v_stunstick.mdl")
SWEP.WorldModel = Model("models/weapons/w_stunbaton.mdl")
SWEP.Sound = Sound("weapons/stunstick/stunstick_swing1.wav")
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = ""
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
function SWEP:Initialize()
if SERVER then self:SetWeaponHoldType("normal") end
end
function SWEP:PrimaryAttack()
if CurTime() < self.NextStrike then return end
if SERVER then
self:SetWeaponHoldType("melee")
timer.Simple(0.3, function(wep) if wep:IsValid() then wep:SetWeaponHoldType("normal") end end, self)
end
self.Owner:SetAnimation(PLAYER_ATTACK1)
self.Weapon:EmitSound(self.Sound)
self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
self.NextStrike = CurTime() + .4
if CLIENT then return end
local trace = self.Owner:GetEyeTrace()
if trace.Entity:GetClass() == "prop_ragdoll" then
for k,v in pairs(player.GetAll()) do
if trace.Entity.OwnerINT and trace.Entity.OwnerINT == v:EntIndex() then
KnockoutToggle(v, true)
return
end
end
end
if not ValidEntity(trace.Entity) or (self.Owner:EyePos():Distance(trace.Entity:GetPos()) > 115) or (not trace.Entity:IsPlayer() and not trace.Entity:IsNPC()) then
return
end
if CfgVars["needwantedforarrest"] == 1 and not trace.Entity:IsNPC() and not trace.Entity:GetNWBool("wanted") then
Notify(self.Owner, 1, 5, "The player must be wanted in order to be able to arrest them.")
return
end
local jpc = DB.CountJailPos()
if not jpc or jpc == 0 then
Notify(self.Owner, 1, 4, "You cannot arrest people since there are no jail positions set!")
else
-- Send NPCs to Jail
if trace.Entity:IsNPC() then
trace.Entity:SetPos(DB.RetrieveJailPos())
else
if not trace.Entity.Babygod then
trace.Entity:Arrest()
Notify(trace.Entity, 1, 4, "You've been arrested by " .. self.Owner:Nick())
else
Notify(self.Owner, 1, 4, "You can't arrest players who are spawning.")
end
end
end
end
function SWEP:SecondaryAttack()
if CurTime() < self.NextStrike then return end
if SERVER then
self:SetWeaponHoldType("melee")
timer.Simple(0.3, function(wep) if wep:IsValid() then wep:SetWeaponHoldType("normal") end end, self)
end
self.Owner:SetAnimation(PLAYER_ATTACK1)
self.Weapon:EmitSound(self.Sound)
self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
self.NextStrike = CurTime() + .4
if CLIENT then return end
local trace = self.Owner:GetEyeTrace()
if not ValidEntity(trace.Entity) or not trace.Entity:IsPlayer() or (self.Owner:EyePos():Distance(trace.Entity:GetPos()) > 115) or not trace.Entity:GetNWBool("Arrested") then
return
end
trace.Entity:Unarrest()
Notify(trace.Entity, 1, 4, "You were unarrested by " .. self.Owner:Nick())
end
[/lua][/QUOTE]
Ah damn, I was just gonna post the same thing...
Also:
function SWEP:Initialize()
[lua]function SWEP:Initialize()
self:SetWeaponHoldType("normal") end
end[/lua]
Fixed
[QUOTE=Jocken300;26309334]Ah damn, I was just gonna post the same thing...
Also:
function SWEP:Initialize()
[lua]function SWEP:Initialize()
self:SetWeaponHoldType("normal") end
end[/lua]
Fixed[/QUOTE]
k
Sorry, you need to Log In to post a reply to this thread.