Garry's Mod

Garry's Mod

509 beoordelingen
TTT M60
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Realism
Bestandsgrootte
Geplaatst op
Bijgewerkt op
6.834 MB
5 apr 2015 om 23:33
10 jul 2015 om 15:24
5 wijzigingsnotities (weergeven)

Abonneren om te downloaden
TTT M60

Omschrijving
A weapon for the Garry's Mod addon Trouble in Terrorist Town (TTT)

This weapon was designed for Innocent's use.

Weapon Stats:
200 round box
14.5 damage per body shot
0.1275 delay between firing

Note: I did not make the weapon model and do not take credit for it. I will remove this if the creator wants me to.
15 opmerkingen
Dorito 22 okt 2016 om 21:05 
Can I Use This Outside Of TTT?
Medicare 11 jul 2015 om 16:56 
Here you are, this is exactly as I'm using it on my server and I don't get any lua script errors.
http://pastebin.com/YiYaUWm1
There are a couple other changes in there too, just a heads up.
FrostyIce  [auteur] 11 jul 2015 om 3:05 
I'll have to look more in depth into your code when I have time. So far, when I put your changes in, the game has a draw error. If you want to just put the entire shared.lua file up on pastebin, it'll alleviate any errors that you may have when pasting. But, as of right now, I get the following when running it.

[ERROR] addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:220: attempt to call method 'SetRenderOrigin' (a nil value)
1. DrawWorldModel - addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:220
2. unknown - addons/m60/lua/weapons/weapon_ttt_m60/shared.lua:180

Thanks for the attempt, anyways. Glad to see someone take an interest in it.
Medicare 10 jul 2015 om 17:27 
And in the SWEP:DrawWorldModel code, change the if not IsValid(self.owner) part to:

if not IsValid( self.Owner ) then
self:SetRenderOrigin(self.Pos)
self:SetRenderAngles(self.Ang)
self:DrawModel( )
return
end

and the if not hand part to:
if not hand then
self:SetRenderOrigin(self.Pos)
self:SetRenderAngles(self.Ang)
self:DrawModel( )
return
end
Medicare 10 jul 2015 om 17:25 
After experimenting a bit more, I think I found a better fix that should eliminate the problem all together. It seems as though for some reason the game will sometimes not draw the weapon immediately after drop, so you have to force it to draw. The CalcAbsolutePosition code keeps track of where the weapon ACTUALLY is in the world.
You may want to check and confirm that this code is working though, I may have missed something when copying it into here:

SWEP.Pos = nil
SWEP.Ang = nil

function SWEP:CalcAbsolutePosition(pos, ang)
self.Pos = pos
self.Ang = ang
return
end

SWEP.Offset = {
Pos = {
Up = 0,
Right = 1,
Forward = -3,
},
Ang = {
Up = 0,
Right = 0,
Forward = 0,
}
}

function SWEP:Think()
self:DrawWorldModel( )
end

function SWEP:RenderOverride()
self:DrawWorldModel()
end

function SWEP:OnDrop()
self.Owner = nil
end
FrostyIce  [auteur] 10 jul 2015 om 15:26 
Alright, the gma has been updated. Thanks for the help. If you don't mind, I gave you credit in the change notes for the new code.
Medicare 9 jul 2015 om 21:09 
So I was having a play around with this and I think I partially solved the problem with the world model being drawn stationary in the air after drop.

Inside the SWEP:DrawWorldModel() code, remove the first clause:

if not IsValid( self.Owner ) then return end

and replace it with:

if not IsValid( self.Owner ) then
self:SetRenderOrigin(self:GetNetworkOrigin())
self:SetRenderAngles(self:GetNetworkAngles())
self:DrawModel( )
return
end

This KIND OF fixes the problem, the gun will sometimes still be invisible initially but will become visible in the correct location after a time.
FrostyIce  [auteur] 28 apr 2015 om 12:54 
LMG/HMG is just an abbreviated way of saying Light Machine Gun/Heavy Machine Gun, which is what the M60 is.
DH1806 28 apr 2015 om 5:04 
Well I'll do it if you tell me what LMGs/HMGs is :D
FrostyIce  [auteur] 27 apr 2015 om 14:09 
It usually occurs with the LMGs/HMGs, if you look at any of them, they will most likely occur. If you know of one that doesn't have this issue, link it, and I'll see how they calculate the dropped weapon's physics.