- Initiateur de la discussion
Lyko5102
Geek suprême
- Messages
- 88
- Score réaction
- 4
- Points
- 115
Bonsoir/Bonjour à tous
J'ai un petit soucis j'aimerais trouver un stunstick normal mais qui fait exactement la même chose que le stunstick du DarkRP mais je n'aimerais pas que ce stunstick soit blue translucide j'aimerais pouvoir mettre mon model a moi j'ai tenté de copier coller le code du stunstick tout en enlevant les code qui font qu'il est bleue translucide rajouter les lignes de models mais rien y fait..
Je vous met le code mais a mon avis cela ne servirais a rien on va surement me dire que de prendre le code du stunstick du DarkRP me donnera toujours un stunstick translucide..
CODE
J'ai un petit soucis j'aimerais trouver un stunstick normal mais qui fait exactement la même chose que le stunstick du DarkRP mais je n'aimerais pas que ce stunstick soit blue translucide j'aimerais pouvoir mettre mon model a moi j'ai tenté de copier coller le code du stunstick tout en enlevant les code qui font qu'il est bleue translucide rajouter les lignes de models mais rien y fait..
Je vous met le code mais a mon avis cela ne servirais a rien on va surement me dire que de prendre le code du stunstick du DarkRP me donnera toujours un stunstick translucide..
CODE
AddCSLuaFile()
if CLIENT then
SWEP.PrintName = "Combine_Stunstick "
SWEP.Slot = 1
SWEP.SlotPos = 3
SWEP.ViewModel = "models/dpfilms/weapons/v_stunbaton.mdl"
SWEP.WorldModel = "models/dpfilms/weapons/w_stunbaton.mdl"
killicon.AddAlias("stunstick", "weapon_stunstick")
end
DEFINE_BASECLASS("stick_base")
SWEP.Instructions = "Left click pour punir\nClic droit pour blessé\nMaintenir R pour charger le stun."
SWEP.Spawnable = true
SWEP.Category = "Combine_Stunstick"
function SWEP:Initialize()
BaseClass.Initialize(self)
self.Hit = {
Sound("weapons/stunstick/stunstick_impact1.wav"),
Sound("weapons/stunstick/stunstick_impact2.wav")
}
self.FleshHit = {
Sound("weapons/stunstick/stunstick_fleshhit1.wav"),
Sound("weapons/stunstick/stunstick_fleshhit2.wav")
}
end
function SWEP:SetupDataTables()
BaseClass.SetupDataTables(self)
-- Float 0 = LastPrimaryAttack
-- Float 1 = ReloadEndTime
-- Float 2 = BurstTime
-- Float 3 = LastNonBurst
-- Float 4 = SeqIdleTime
-- Float 5 = HoldTypeChangeTime
self:NetworkVar("Float", 6, "LastReload")
end
function SWEP:Think()
BaseClass.Think(self)
if self.WaitingForAttackEffect and self:GetSeqIdleTime() ~= 0 and CurTime() >= self:GetSeqIdleTime() - 0.35 then
self.WaitingForAttackEffect = false
local effectData = EffectData()
effectData:SetOrigin(self:GetOwner():GetShootPos() + (self:GetOwner():EyeAngles():Forward() * 45))
effectData:SetNormal(self:GetOwner():EyeAngles():Forward())
util.Effect("StunstickImpact", effectData)
end
end
function SWEP: DoFlash(ply)
if not IsValid(ply) or not ply:IsPlayer() then return end
ply:ScreenFade(SCREENFADE.IN, color_white, 1.2, 0)
end
local entMeta = FindMetaTable("Entity")
function SWEP: DoAttack(dmg)
if CLIENT then return end
self:GetOwner():LagCompensation(true)
local trace = util.QuickTrace(self:GetOwner():EyePos(), self:GetOwner():GetAimVector() * 90, {self:GetOwner()})
self:GetOwner():LagCompensation(false)
if IsValid(trace.Entity) and trace.Entity.onStunStickUsed then
trace.EntitynStunStickUsed(self:GetOwner())
return
elseif IsValid(trace.Entity) and trace.Entity:GetClass() == "func_breakable_surf" then
trace.Entity:Fire("Shatter")
self:GetOwner():EmitSound(self.Hit[math.random(1,#self.Hit)])
return
end
self.WaitingForAttackEffect = true
local ent = self:GetOwner():getEyeSightHitEntity(self.stickRange, 15, fn.FAnd{fp{fn.Neq, self:GetOwner()}, fc{IsValid, entMeta.GetPhysicsObject}})
if not IsValid(ent) then return end
if ent:IsPlayer() and not ent:Alive() then return end
if not ent:isDoor() then
ent:SetVelocity((ent:GetPos() - self:GetOwner():GetPos()) * 7)
end
if dmg > 0 then
ent:TakeDamage(dmg, self:GetOwner(), self)
end
if ent:IsPlayer() or ent:IsNPC() or ent:IsVehicle() then
selfoFlash(ent)
self:GetOwner():EmitSound(self.FleshHit[math.random(1,#self.FleshHit)])
else
self:GetOwner():EmitSound(self.Hit[math.random(1,#self.Hit)])
if FPP and FPP.plyCanTouchEnt(self:GetOwner(), ent, "EntityDamage") then
if ent.SeizeReward and not ent.beenSeized and not ent.burningup and self:GetOwner():isCP() and ent.Getowning_ent and self:GetOwner() ~= ent:Getowning_ent() then
self:GetOwner():addMoney(ent.SeizeReward)
DarkRP.notify(self:GetOwner(), 1, 4, DarkRP.getPhrase("you_received_x", DarkRP.formatMoney(ent.SeizeReward), DarkRP.getPhrase("bonus_destroying_entity")))
ent.beenSeized = true
end
ent:TakeDamage(1000-dmg, self:GetOwner(), self) -- for illegal entities
end
end
end
function SWEPrimaryAttack()
BaseClass.PrimaryAttack(self)
self:SetNextSecondaryFire(self:GetNextPrimaryFire())
selfoAttack(5)
end
if CLIENT then
SWEP.PrintName = "Combine_Stunstick "
SWEP.Slot = 1
SWEP.SlotPos = 3
SWEP.ViewModel = "models/dpfilms/weapons/v_stunbaton.mdl"
SWEP.WorldModel = "models/dpfilms/weapons/w_stunbaton.mdl"
killicon.AddAlias("stunstick", "weapon_stunstick")
end
DEFINE_BASECLASS("stick_base")
SWEP.Instructions = "Left click pour punir\nClic droit pour blessé\nMaintenir R pour charger le stun."
SWEP.Spawnable = true
SWEP.Category = "Combine_Stunstick"
function SWEP:Initialize()
BaseClass.Initialize(self)
self.Hit = {
Sound("weapons/stunstick/stunstick_impact1.wav"),
Sound("weapons/stunstick/stunstick_impact2.wav")
}
self.FleshHit = {
Sound("weapons/stunstick/stunstick_fleshhit1.wav"),
Sound("weapons/stunstick/stunstick_fleshhit2.wav")
}
end
function SWEP:SetupDataTables()
BaseClass.SetupDataTables(self)
-- Float 0 = LastPrimaryAttack
-- Float 1 = ReloadEndTime
-- Float 2 = BurstTime
-- Float 3 = LastNonBurst
-- Float 4 = SeqIdleTime
-- Float 5 = HoldTypeChangeTime
self:NetworkVar("Float", 6, "LastReload")
end
function SWEP:Think()
BaseClass.Think(self)
if self.WaitingForAttackEffect and self:GetSeqIdleTime() ~= 0 and CurTime() >= self:GetSeqIdleTime() - 0.35 then
self.WaitingForAttackEffect = false
local effectData = EffectData()
effectData:SetOrigin(self:GetOwner():GetShootPos() + (self:GetOwner():EyeAngles():Forward() * 45))
effectData:SetNormal(self:GetOwner():EyeAngles():Forward())
util.Effect("StunstickImpact", effectData)
end
end
function SWEP: DoFlash(ply)
if not IsValid(ply) or not ply:IsPlayer() then return end
ply:ScreenFade(SCREENFADE.IN, color_white, 1.2, 0)
end
local entMeta = FindMetaTable("Entity")
function SWEP: DoAttack(dmg)
if CLIENT then return end
self:GetOwner():LagCompensation(true)
local trace = util.QuickTrace(self:GetOwner():EyePos(), self:GetOwner():GetAimVector() * 90, {self:GetOwner()})
self:GetOwner():LagCompensation(false)
if IsValid(trace.Entity) and trace.Entity.onStunStickUsed then
trace.EntitynStunStickUsed(self:GetOwner())
return
elseif IsValid(trace.Entity) and trace.Entity:GetClass() == "func_breakable_surf" then
trace.Entity:Fire("Shatter")
self:GetOwner():EmitSound(self.Hit[math.random(1,#self.Hit)])
return
end
self.WaitingForAttackEffect = true
local ent = self:GetOwner():getEyeSightHitEntity(self.stickRange, 15, fn.FAnd{fp{fn.Neq, self:GetOwner()}, fc{IsValid, entMeta.GetPhysicsObject}})
if not IsValid(ent) then return end
if ent:IsPlayer() and not ent:Alive() then return end
if not ent:isDoor() then
ent:SetVelocity((ent:GetPos() - self:GetOwner():GetPos()) * 7)
end
if dmg > 0 then
ent:TakeDamage(dmg, self:GetOwner(), self)
end
if ent:IsPlayer() or ent:IsNPC() or ent:IsVehicle() then
selfoFlash(ent)
self:GetOwner():EmitSound(self.FleshHit[math.random(1,#self.FleshHit)])
else
self:GetOwner():EmitSound(self.Hit[math.random(1,#self.Hit)])
if FPP and FPP.plyCanTouchEnt(self:GetOwner(), ent, "EntityDamage") then
if ent.SeizeReward and not ent.beenSeized and not ent.burningup and self:GetOwner():isCP() and ent.Getowning_ent and self:GetOwner() ~= ent:Getowning_ent() then
self:GetOwner():addMoney(ent.SeizeReward)
DarkRP.notify(self:GetOwner(), 1, 4, DarkRP.getPhrase("you_received_x", DarkRP.formatMoney(ent.SeizeReward), DarkRP.getPhrase("bonus_destroying_entity")))
ent.beenSeized = true
end
ent:TakeDamage(1000-dmg, self:GetOwner(), self) -- for illegal entities
end
end
end
function SWEPrimaryAttack()
BaseClass.PrimaryAttack(self)
self:SetNextSecondaryFire(self:GetNextPrimaryFire())
selfoAttack(5)
end