Garry's Mod

Garry's Mod

508 Bewertungen
TTT M60
   
Preis verleihen
Favorisieren
Favorisiert
Entfernen
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Realism
Dateigröße
Veröffentlicht
Aktualisiert
6.834 MB
5. Apr. 2015 um 23:33
10. Juli 2015 um 15:24
5 Änderungshinweise (anzeigen)

Abonnieren zum Herunterladen
TTT M60

Beschreibung
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 Kommentare
Dorito 22. Okt. 2016 um 21:05 
Can I Use This Outside Of TTT?
*Sam 11. Juli 2015 um 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  [Autor] 11. Juli 2015 um 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.
*Sam 10. Juli 2015 um 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
*Sam 10. Juli 2015 um 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  [Autor] 10. Juli 2015 um 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.
*Sam 9. Juli 2015 um 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  [Autor] 28. Apr. 2015 um 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 um 5:04 
Well I'll do it if you tell me what LMGs/HMGs is :D
FrostyIce  [Autor] 27. Apr. 2015 um 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.