Author Topic: Ragdoll Error - See two ragdolls using !ragdoll  (Read 496 times)

0 Members and 1 Guest are viewing this topic.

Offline sodak

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Ragdoll Error - See two ragdolls using !ragdoll
« on: September 12, 2016, 03:24:39 PM »
Hey Team,

i have a big issue, always i use !ragdoll or /sleep (on darkrp) or using donkies stungun swep i see, two ragdoll models. Here a screen from my issue:



The Stungun addon dont causes this. the simple third person, too got the same issue on my ttt server with custom models or the normal models.

Already asked on FP and darkrp forums and the normal answer is disabling keep corpses but that dont help me.
Maybe u have a solution.

thanks

with kind regards
Sodak

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6097
  • Karma: 374
  • Project Lead
    • View Profile
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #1 on: September 15, 2016, 04:19:13 PM »
Do other players in your server also see two ragdolls?
Experiencing God's grace one day at a time.

Offline sodak

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #2 on: September 15, 2016, 05:50:45 PM »
Hey Megiddo, yes other user see it too... Sry i forget to write this little information.

It happens to me and to other users.

!ragdoll  /sleep or the stungun weapon. Using DarkRP and latest ULX.

It happens on my TTT Server, too with the normal models.

Offline sodak

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #3 on: September 18, 2016, 04:53:39 PM »
Update:

I see it happens on every model.

I dont know the error... is it ulx related, or garrysmod related... my ttt server has the same problem while using stungun and pointshop models

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2421
  • Karma: 368
    • View Profile
    • |G4P| Gman4President
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #4 on: September 18, 2016, 05:01:40 PM »
It sounds like you have a conflicting addon that might be doing something with the CreateRagdoll function.

Can you please try running ULX on a server with NO other addons and see if you get this issue? Preferably Sandbox gamemode.

Offline sodak

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #5 on: September 19, 2016, 01:57:26 AM »
Thank u MrPresident, now i checked all up and saw that this Addon: http://steamcommunity.com/sharedfiles/filedetails/?id=308977650
But i need this addon and dont find the problem in the lua file (its just one^^)
I guess it has something to do with this line: (Probably u can help me to fix it that it works normal but without this view addon.. now i removed it from my server till i get a fix for that issue, the author is very inactive)   Update: hook.Add("Think","SetPlayerCamoAlpha",CheckPlayerStill)  the Think hook causes this if i remove think out of this it fixed but the model is not in full cloak mode just in the mode while moving

Quote
if SERVER then
   local function CheckPlayerStill()
      for k,v in ipairs(player.GetAll()) do
         if v:GetNWBool("CamoEnabled") then
            if v:GetVelocity():Length() <= 1 then
               v:SetNoDraw(true)
            else
               v:SetNoDraw(false)
            end
         else
            v:SetNoDraw(false)
         end
      end
   end
   hook.Add("Think","SetPlayerCamoAlpha",CheckPlayerStill)
   
   local function CheckPlayerDead(ply)
      local CamoIsOn = ply:GetNWBool("CamoEnabled")
      
      if CamoIsOn then
         ply:SetNWBool("CamoEnabled",false)
         NPC_SwitchRelationship(ply,false)
      end
   end
   hook.Add("PlayerDeath","RemoveDeadPlayerCamo",CheckPlayerDead)
end
  (Its this Function that causes this)


Code: [Select]
if CLIENT then
SWEP.PrintName = "Active Camouflage"
SWEP.Author = "Master Pro11™"
SWEP.Slot = 2
SWEP.SlotPos = 1
SWEP.WepSelectIcon = surface.GetTextureID("camo/camo_wepselecticon.vmt")
end

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Ammo = "none"
SWEP.DrawAmmo = false

SWEP.HoldType = "normal"
SWEP.Category = "Master's Weapons"
SWEP.UseHands = false

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.Primary.Automatic= false

SWEP.ViewModel = "models/weapons/c_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_pistol.mdl"

local CamoActivate = Sound("camo/camo_on.wav")
local CamoDeactivate = Sound("camo/camo_off.wav")

local CamoMat = Material("camo/camo_shade.vmt")
local CamoOverlayMat = "camo/camo_overlay.vmt"
local CamoIconMat = "camo/camo_icon.vmt"

SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false

function SWEP:PrimaryAttack()
self:SetNextPrimaryFire(CurTime() + 3)
local CamoIsOn = self.Owner:GetNWBool("CamoEnabled")

if SERVER then
self.Owner:SetNWBool("CamoEnabled",!CamoIsOn)
if CamoIsOn then
NPC_SwitchRelationship(self.Owner,false)
else
NPC_SwitchRelationship(self.Owner,true)
end
elseif CLIENT then
if CamoIsOn then
surface.PlaySound(CamoDeactivate)
elseif !CamoIsOn then
surface.PlaySound(CamoActivate)
end
end
end

function NPC_SwitchRelationship(ply,yn)
if SERVER then
for k,v in ipairs(ents.FindByClass("npc_*")) do
if !yn then
v:AddEntityRelationship(ply,D_HT,99)
else
v:AddEntityRelationship(ply,D_NU,99)
end
end
end
end

if CLIENT then
local colorMofify = {
["$pp_colour_addr"] = 0,
["$pp_colour_addg"] = 0,
["$pp_colour_addb"] = 0,
["$pp_colour_brightness"] = 0,
["$pp_colour_contrast"] = 1,
["$pp_colour_colour"] = 0,
["$pp_colour_mulr"] = 0,
["$pp_colour_mulg"] = 0,
["$pp_colour_mulb"] = 0,
}

local function DrawCamoEffects()
if LocalPlayer():GetNWBool("CamoEnabled") then
DrawColorModify(colorMofify)
DrawMotionBlur(0.1, 0.5, 0.01)
DrawToyTown(2,ScrH()/2)
end
end
hook.Add("RenderScreenspaceEffects","ShowCamoEffects",DrawCamoEffects)

local CamoOverlayID = surface.GetTextureID(CamoOverlayMat)
local CamoIconID = surface.GetTextureID(CamoIconMat)
local CamoIconSize = ScrH()/5
local CamoIconY = (ScrH()/2)+(ScrH()/5)
local CamoIconX = (ScrW()/2)-(CamoIconSize/2)

local function DrawCamoItems()
if LocalPlayer():GetNWBool("CamoEnabled") then
surface.SetDrawColor(255,255,255,255)
surface.SetTexture(CamoOverlayID)
surface.DrawTexturedRect(0,0,ScrW(),ScrH())

surface.SetDrawColor(0,0,0,255)
surface.SetTexture(CamoIconID)
surface.DrawTexturedRect(CamoIconX,CamoIconY,CamoIconSize,CamoIconSize)
end
end
hook.Add("HUDPaint","DrawActiveCamoItems",DrawCamoItems)

local function DrawPlayerMaterial(ply)
if ply:GetNWBool("CamoEnabled") then
render.ModelMaterialOverride(CamoMat)
end
end
hook.Add("PrePlayerDraw","DrawPlayerCamo",DrawPlayerMaterial)

local function UndoPlayerMaterial(ply)
render.ModelMaterialOverride()
end
hook.Add("PostPlayerDraw","UndoPlayerCamo",UndoPlayerMaterial)
end

if SERVER then
local function CheckPlayerStill()
for k,v in ipairs(player.GetAll()) do
if v:GetNWBool("CamoEnabled") then
if v:GetVelocity():Length() <= 1 then
v:SetNoDraw(true)
else
v:SetNoDraw(false)
end
else
v:SetNoDraw(false)
end
end
end
hook.Add("Think","SetPlayerCamoAlpha",CheckPlayerStill)

local function CheckPlayerDead(ply)
local CamoIsOn = ply:GetNWBool("CamoEnabled")

if CamoIsOn then
ply:SetNWBool("CamoEnabled",false)
NPC_SwitchRelationship(ply,false)
end
end
hook.Add("PlayerDeath","RemoveDeadPlayerCamo",CheckPlayerDead)
end

function SWEP:SecondaryAttack()
return
end

function SWEP:Initialize()
self:SetWeaponHoldType(self.HoldType)
end

function SWEP:Deploy()
self:SetNextPrimaryFire(CurTime() + .2)
self.Owner:DrawViewModel(false)
end

function SWEP:DrawWorldModel()
return false
end

function SWEP:Reload()
return
end

I removed the Think Function and now it dont this error.
But now when i go in the camo mode i get not fully invisible its shows the material like moving in invisible.
i need a fix for make me full inviisible if i stand still and dont move.


Here is the video how the addon works:

https://www.youtube.com/watch?v=1uQ7KjrQI1k
« Last Edit: September 19, 2016, 03:48:00 AM by sodak »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2421
  • Karma: 368
    • View Profile
    • |G4P| Gman4President
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #6 on: September 19, 2016, 08:07:50 AM »
I'm sorry, but we don't have the time to help you fix another author's addon either. Your best bet is to either wait for someone to help you here (there are some pretty smart community members) or take this support question to the workshop page for this addon and wait for the original author to post a fix.

Moving this thread to Dev Corner.

Offline sodak

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Ragdoll Error - See two ragdolls using !ragdoll
« Reply #7 on: September 19, 2016, 05:19:37 PM »
thank u MrPresident u helped me alot with the test all addons thing. the problem with this addon its... inactive sadly and used very often on swrp servers. So i have to w8 for a community member.

I fixed it now so:

Its no double ragdoll, and im not full invisible... maybe i should try to implement the ulx cloak function but dk if this work. im wating for others hand. its better to w8 for answers from other coders :)