Ironsights messed up on Prop Hunt?

Hello,

I have a question,

Whenever I try adding a custom weapon to Prop Hunt the iron sights end up messed up like this:

I have tried several bases but still the same problem.

Im guessing it is something got to do with the game mode files as:

The funny thing is whenever I start the game on Single Player sandbox and load up the weapon it is completely fine just like this:

Can I get some help please :).

What weapons base are you using? Have you tried checking through the prop hunt code to see if it’s changing the iron sight position?

So far I have tried, CS Real base, M9K base and the Prop Hunt V2 base.

All of them, same problem,

I have tried checking the code to see if it’s changing the iron sight position but without success, if anyone can guide me if that is the problem that’d be great.

Which prop hunt are you using?

Oh, I can help here since I had the same issue. If you’re using the copy of Prop Hunt on the fretta base, then the problem is caused by the gamemode overriding CalcView, which started becoming a problem with the new Gmod update! Go into gamemodes/fretta or where ever it’s located and go to line 213

Replace



function GM:CalcView( ply, origin, angles, fov )

	local view = ply:CallClassFunction( "CalcView", origin, angles, fov ) or { ["origin"] = origin, ["angles"] = angles, ["fov"] = fov };
	
	origin = view.origin or origin
	angles = view.angles or angles
	fov = view.fov or fov
		
	local wep = ply:GetActiveWeapon()
	if ( IsValid( wep ) ) then
	
		local func = wep.GetViewModelPosition
		if ( func ) then view.vm_origin,  view.vm_angles = func( wep, origin*1, angles*1 ) end
		
		local func = wep.CalcView
		if ( func ) then view.origin, view.angles, view.fov = func( wep, ply, origin*1, angles*1, fov ) end
	
	end

	return view
	
end


with



function GM:CalcView( ply, origin, angles, fov )

	local view = ply:CallClassFunction( "CalcView", origin, angles, fov ) or { ["origin"] = origin, ["angles"] = angles, ["fov"] = fov };
	
	origin = view.origin or origin
	angles = view.angles or angles
	fov = view.fov or fov
		
	local wep = ply:GetActiveWeapon()
	if ( IsValid( wep ) ) then
		
		local func = wep.CalcView
		if ( func ) then view.origin, view.angles, view.fov = func( wep, ply, origin*1, angles*1, fov ) end
	
	end

	return view
	
end


Thanks for the reply,

code_gs, I am using http://steamcommunity.com/sharedfiles/filedetails/?id=207938283

Prop Hunt ULX Version, as the other versions were causing me problems in voting,

NiandraLades, I have just tried that, changed the shared.lua of gamemodes/fretta but the iron sights are still messed up and going to the left?
Maybe its because of the different version?

[editline]9th May 2014[/editline]

Maybe i have to edit somewhere different,

if you have any idea on this problem please reply

I have just tried many versions of Fretta and Prop hunt but non of them work :(,

I don’t understand what is wrong.

I have found something,

I don’t think it is that hook that is affecting the iron sights, as even if the whole hook is removed the game mode runs fine and the issue persists.

Do me a favour, can you post the original code for gamemodes/fretta/shared.lua?

Sure, this is it for the current version I am trying, the original

Also its gamemodes\fretta\gamemode\shared.lua

Im just going to give up on this one and say Prop hunt doesn’t work well with custom weapons which is why i have decided to just leave the weapons without iron sights,

Thanks for everyone that answered,