Jump to content

Fix Handcuff/Surrender Bug [Completed]


SweptThr.one

Recommended Posts

I got pulled to a sit yesterday because I pulled out a gun while handcuffed because the server allowed me to.  Just fix this issue, it should take three seconds:

hook.Add( "OnHandcuffed", whatever, function( ply, cuffed, cuffs )
	if cuffed:HasWeapon( surrendered_weapon ) then
		cuffed:StripWeapon( surrendered_weapon )
		cuffed:SelectWeapon( restrained_weapon )
	end
end )

You shouldn't use ply.SelectWeapon though, there are better ways.

Link to comment
Share on other sites

In Progress!

Head Admin SCP-RP || Event Team Overseer || Ethics Committee || Ex Security FTO 1LT || Ex Security Warden || Ex CI R&D Senior Agent || UMC Guest [LVL 0] || Former Research Researcher || Former DORSU || Former DOC || Former LCZ Manager ||  I aM sPeCiAl || 

Link to comment
Share on other sites

  • 1 month later...
  • Owner
On 12/9/2022 at 6:39 PM, SweptThr.one said:
hook.Add( "OnHandcuffed", whatever, function( ply, cuffed, cuffs )
	if cuffed:HasWeapon( surrendered_weapon ) then
		cuffed:StripWeapon( surrendered_weapon )
		cuffed:SelectWeapon( restrained_weapon )
	end
end )

Freaking spaghetti code lol

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...