View Single Post
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 11-10-2017 , 17:54   Re: REQ: Auto strip weapons from player at round start/end [Can pay]
Reply With Quote #8

Quote:
Originally Posted by Zeddy_god View Post
Hey mitch, tried it, it works on some maps, and doesnt work on some. Also caused a few crashes on some maps.

Is there any way to do it safely without the crashes? Maybe execute losing weapons 5 seconds into the round? I can add freeze time to balance it.
What I've done for stripping weapons that hasnt resulted in crashes is use a player spawn hook, then make a 1.0 second timer, and strip weapons after than. I didnt even use an IsValidEdict check because checking if GetPlayerWeaponSlot returns -1 will notify if it is invalid (if the check is still needed, and I'm incorrect about that, let me know). I threw something together for you real quick that has a variable to control the delay. Hope it works with your map issue.
Attached Files
File Type: sp Get Plugin or Get Source (togweaponstripper.sp - 180 views - 2.2 KB)
File Type: smx togweaponstripper.smx (9.6 KB, 184 views)
File Type: inc autoexecconfig.inc (19.4 KB, 182 views)
__________________
ThatOneGuy is offline