pebcak 0 Posted March 18, 2007 Is there a way to prevent a player in a MP game from picking up extra weapons? For example, prevent someone playing a Civilian from picking up any weapons greater than pistols. They would need to be allowed to pick up extra pistol ammo and perhaps nades, however. Share this post Link to post Share on other sites
Messiah 2 Posted March 18, 2007 it wouldn't be possible to 'prevent' them from picking up weapons, but you can use the hasweapon command to check what weapon the player has (using an array of the weapons he's not allowed), if it's one of the banned weapons then you can then use the removeweapon command to take it off them. Share this post Link to post Share on other sites
pebcak 0 Posted March 18, 2007 Hmmn. Right. Okay. Not quite sure how to do that yet. Quick code sample to get me on the way..? Share this post Link to post Share on other sites
5133p39 14 Posted March 18, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_allowWeapons = ["M9","M9SD","Makarov","MakarovSD"]; { If( not (_x In _allowWeapons) ) Then { Hint Format["The weapon %1 is not allowed!!!", _x]; }; } forEach Weapons _u; This example will tell you if the unit is in possesion of a forbidden weapon. The only weapons allowed in this example are M9 and Makarov pistols, including suppressed versions. Note that grenades are magazines, not weapons, so if you want to check for them, you need to use the magazines command. Variable '_u' refers to the unit whose weapons you want to check. Variable '_x' is a "magic variable" available within the forEach scope, which is refering to one of the unit's weapons. Share this post Link to post Share on other sites