SA-MP Forums Archive
How to disable changing weapons - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to disable changing weapons (/showthread.php?tid=509613)



How to disable changing weapons - HitterHitman - 27.04.2014

Hello guys, I want to know how to disable changing weapons i.e weapons can only be changed by setplayerarmedweapon, I have tried some includes but they don't work. Thanks,


Re: How to disable changing weapons - HitterHitman - 27.04.2014

But I want them to have their weapons, just don't allow them to switch them as i want to create a weapon equip system so that players can use only use equiped weapon.


Re: How to disable changing weapons - Bingo - 27.04.2014

Quote:
Originally Posted by HitterHitman
Посмотреть сообщение
But I want them to have their weapons, just don't allow them to switch them as i want to create a weapon equip system so that players can use only use equiped weapon.
Uhm,

First disarm them and then give them that weapon which you want them to use.

Or as ****** said.


Re: How to disable changing weapons - HitterHitman - 27.04.2014

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Uhm,

First disarm them and then give them that weapon which you want them to use.

Or as ****** said.
Isn't there any way set their weapon back to previous weapon they have in their hand?


Re: How to disable changing weapons - Bingo - 27.04.2014

Quote:
Originally Posted by HitterHitman
Посмотреть сообщение
Isn't there any way set their weapon back to previous weapon they have in their hand?
Never tried though.


Re: How to disable changing weapons - HitterHitman - 27.04.2014

Thanks everybody, I have done that.


Re: How to disable changing weapons - Konstantinos - 27.04.2014

Well there is a way but what ****** said is way simplier.

Anyways you can store the player's weapon in an array and check their weapons. If the current weapon is not the saved one, then use SetPlayerArmedWeapon and set to the old weapon.