voiceofarma 24 Posted February 14, 2015 Hi everone I'm just looking for a script or anything that can put it in a mission which causes no player can use weapon thermal scopes or it's function, any help would be useful for all arma 3 players specially from you developers! thanks Share this post Link to post Share on other sites
whiztler 137 Posted February 14, 2015 Have a peek here: https://community.bistudio.com/wiki/disableTIEquipment Share this post Link to post Share on other sites
voiceofarma 24 Posted February 14, 2015 Have a peek here: https://community.bistudio.com/wiki/disableTIEquipment thanks but that's for vehicles not rifle scopes, also it would be great if there's anyway to remove all thermal scopes from arsenal so players won't use them. Share this post Link to post Share on other sites
R3vo 2654 Posted February 14, 2015 (edited) thanks but that's for vehicles not rifle scopes, also it would be great if there's anyway to remove all thermal scopes from arsenal so players won't use them. Here you go. It's nowhere near a perfect solution, but at least it works ;) [color="#FF8040"][color="#1874CD"]_NVS[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"optic_NVS "[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_nightstalker[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"optic_Nightstalker"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_tws[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"optic_tws"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_twsMg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"optic_tws_mg"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_NVS[/color] [color="#191970"][b]in[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]primaryWeaponItems[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]or[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_nightstalker[/color] [color="#191970"][b]in[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]primaryWeaponItems[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]or[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_tws[/color] [color="#191970"][b]in[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]primaryWeaponItems[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]or[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_twsMg[/color] [color="#191970"][b]in[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]primaryWeaponItems[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removePrimaryWeaponItem[/b][/color] [color="#1874CD"]_NVS[/color] [color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removePrimaryWeaponItem[/b][/color] [color="#1874CD"]_nightstalker[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removePrimaryWeaponItem[/b][/color] [color="#1874CD"]_tws[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removePrimaryWeaponItem[/b][/color] [color="#1874CD"]_twsMg[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]isPlayer[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]hintSilent[/b][/color] [color="#191970"][b]format[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"%1 was using a restricted weapon. Weapon has been removed."[/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]name[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]allUnits[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]10[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter You could also try to add a virtual ammobox with : [color="#FF8040"]arsenal [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"AmmoboxInit"[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color]this[color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color] BIS_fnc_arsenal[color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter And the remove the optics from it afterwards with: [color="#FF8040"][color="#8B3E2F"][b][[/b][/color]NameOfBox[color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"optic_tws_mg"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"optic_Nightstalker"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"optic_tws"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"optic_NVS "[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_removeVirtualWeaponCargo[color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter However, I've never tried this method myself. Edited February 14, 2015 by R3vo Share this post Link to post Share on other sites
voiceofarma 24 Posted February 14, 2015 thanks for help i'm just a little new to editing, so I must create a sqf file, put your codes there and put it in mission pbo file? or just put it in trigger? Share this post Link to post Share on other sites
R3vo 2654 Posted February 14, 2015 (edited) you can create a sqf file called removeOptics.sqf . Afterwards you put following line into a trigger or into the init.sqf in your mission folder. _removeOptics = [] execVM "removeOptics.sqf"; Make sure that the trigger condition is set to true. Here is a sample mission: https://www.dropbox.com/s/qtizot1kmpok4ff/sampeMission.VR.zip?dl=0 Edited February 14, 2015 by R3vo Share this post Link to post Share on other sites
voiceofarma 24 Posted February 14, 2015 (edited) thanks so much for your help mate i'm going to start my pc and see how it will going! ---------- Post added at 22:57 ---------- Previous post was at 22:48 ---------- thanks that is working but not exactly like I though! when player use a thermal scope after about 5 seconds it removed automatically! anyway that's good and thank you, but it would be possible that they never show up in arsenal? that's better. Edited February 14, 2015 by VoiceOfArmA Share this post Link to post Share on other sites
R3vo 2654 Posted February 14, 2015 I also posted a method which ( hopefully) removes the optics from the arsenal. Just keep in mind that players will still have acess to them via ammoboxes or virtual ammoboxes. Share this post Link to post Share on other sites
voiceofarma 24 Posted February 14, 2015 I also posted a method which ( hopefully) removes the optics from the arsenal. Just keep in mind that players will still have acess to them via ammoboxes or virtual ammoboxes. no problem there is no any ammo box in our mission except an arsenal! thanks Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 14, 2015 The code I use for this. It would be simpler and better (IMO), just to remove it from the scenario entirely. The below block allows the whitelisted classes to use the designated optics. To prevent all use, just ' _opticsAllowed = [""]; ' If the person is not allowed to use the optic, it will replace it with a suitable alternative. This reduces the anger/frustration at being out in the field, finding a thermal optic, using it and being left with nothing when it gets taken away. Players do not like this. :) Replacing with alternative soothes the irritation. //-- initPlayerLocal.sqf //-- Runs on client [] spawn { private ["_opticsAllowed","_specialisedOptics"]; _opticsAllowed = [ "B_recon_TL_F", "B_recon_medic_F", "B_recon_LAT_F", "B_recon_exp_F", "B_recon_JTAC_F", "B_recon_F", "B_recon_M_F", "B_spotter_F" ]; _specialisedOptics = [ "optic_Nightstalker", "optic_tws", "optic_tws_mg" ]; while {TRUE} do { if (({_x in (primaryWeaponItems player)} count _specialisedOptics) > 0) then { if (({player isKindOf _x} count _opticsAllowed) < 1) then { {player removePrimaryWeaponItem _x;} count _specialisedOptics; if (player isKindOf "B_sniper_F") then { if ((dayTime > 19.5) || (dayTime < 4.5)) then { player addPrimaryWeaponItem "optic_NVS"; } else { player addPrimaryWeaponItem "optic_SOS"; }; } else { if ((dayTime > 19.5) || (dayTime < 4.5)) then { player addPrimaryWeaponItem "optic_NVS"; } else { player addPrimaryWeaponItem "optic_Hamr"; }; }; // hintSilent ""; }; }; uiSleep 5; }; }; Share this post Link to post Share on other sites
voiceofarma 24 Posted February 14, 2015 The code I use for this.It would be simpler and better (IMO), just to remove it from the scenario entirely. The below block allows the whitelisted classes to use the designated optics. To prevent all use, just ' _opticsAllowed = [""]; ' If the person is not allowed to use the optic, it will replace it with a suitable alternative. This reduces the anger/frustration at being out in the field, finding a thermal optic, using it and being left with nothing when it gets taken away. Players do not like this. :) Replacing with alternative soothes the irritation. //-- initPlayerLocal.sqf //-- Runs on client [] spawn { private ["_opticsAllowed","_specialisedOptics"]; _opticsAllowed = [ "B_recon_TL_F", "B_recon_medic_F", "B_recon_LAT_F", "B_recon_exp_F", "B_recon_JTAC_F", "B_recon_F", "B_recon_M_F", "B_spotter_F" ]; _specialisedOptics = [ "optic_Nightstalker", "optic_tws", "optic_tws_mg" ]; while {TRUE} do { if (({_x in (primaryWeaponItems player)} count _specialisedOptics) > 0) then { if (({player isKindOf _x} count _opticsAllowed) < 1) then { {player removePrimaryWeaponItem _x;} count _specialisedOptics; if (player isKindOf "B_sniper_F") then { if ((dayTime > 19.5) || (dayTime < 4.5)) then { player addPrimaryWeaponItem "optic_NVS"; } else { player addPrimaryWeaponItem "optic_SOS"; }; } else { if ((dayTime > 19.5) || (dayTime < 4.5)) then { player addPrimaryWeaponItem "optic_NVS"; } else { player addPrimaryWeaponItem "optic_Hamr"; }; }; // hintSilent ""; }; }; uiSleep 5; }; }; thanks so I have to create a sqf file called "initPlayerLocal.sqf" with above codes, then what is the trigger? Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 15, 2015 thanks so I have to create a sqf file called "initPlayerLocal.sqf" with above codes, then what is the trigger? What is what trigger? Try to use a nightstalker, let us know what happens. Share this post Link to post Share on other sites
delta99 34 Posted February 15, 2015 What is what trigger?Try to use a nightstalker, let us know what happens. He is very new to scripting. you don't need a trigger for this one. Initplayerlocal.sqf runs for each player when the missions starts. ---------- Post added at 13:51 ---------- Previous post was at 13:48 ---------- This thread gave me an idea. Is there an easy way to expand this to only allow gear from a particular mod only? For example I want to restrict all gear (weapons, uniforms, backpacks) to RHS addon only. How would one iterate over all gear and compare against config for RHS or other addon? Share this post Link to post Share on other sites
voiceofarma 24 Posted February 15, 2015 Thanks @MDCCLXXVI that worked! I though I need to create a trigger too, anyway that works fine.:D Share this post Link to post Share on other sites
R3vo 2654 Posted February 15, 2015 He is very new to scripting.you don't need a trigger for this one. Initplayerlocal.sqf runs for each player when the missions starts. ---------- Post added at 13:51 ---------- Previous post was at 13:48 ---------- This thread gave me an idea. Is there an easy way to expand this to only allow gear from a particular mod only? For example I want to restrict all gear (weapons, uniforms, backpacks) to RHS addon only. How would one iterate over all gear and compare against config for RHS or other addon? I don't think t here is an easy way to do that, except forbidding those addons entirely Share this post Link to post Share on other sites
voiceofarma 24 Posted February 15, 2015 So if there is any mod thermal scope can I add their code name to sqf files and they will be affected too? Share this post Link to post Share on other sites
delta99 34 Posted February 15, 2015 I don't think t here is an easy way to do that, except forbidding those addons entirely I'm not trying to forbid the addon I'm trying to have it so that people can ONLY use gear from the addon (no default BIS crap). In any event searching the config can be done I just don't know how myself properly yet. ---------- Post added at 14:26 ---------- Previous post was at 14:24 ---------- So if there is any mod thermal scope can I add their code name to sqf files and they will be affected too? The above script lists the scopes that are ALLOWED not disallowed. So anything outside that will NOT be allowed. If you want something from a mod to be allowed you'll have to know the class name and then add it to the array _opticsAllowed Share this post Link to post Share on other sites
Jona33 51 Posted February 15, 2015 I'm not trying to forbid the addon I'm trying to have it so that people can ONLY use gear from the addon (no default BIS crap). In any event searching the config can be done I just don't know how myself properly yet. Pretty much all cfgWeapons entries include author="Bohemia Interactive" you could presumably check for that, not sure if there's an easier way though. Share this post Link to post Share on other sites
R3vo 2654 Posted February 15, 2015 I'm not trying to forbid the addon I'm trying to have it so that people can ONLY use gear from the addon (no default BIS crap). In any event searching the config can be done I just don't know how myself properly yet. Sorry mate, guess I got that twisted Share this post Link to post Share on other sites
delta99 34 Posted February 17, 2015 Pretty much all cfgWeapons entries include author="Bohemia Interactive" you could presumably check for that, not sure if there's an easier way though. Yeah, even if you could get that I wouldn't trust it. I've seen many that are not defined by either BIS or addon makers. I have found something that works for weapons maybe. I'm not sure if all attachments and such and/or whether this works on NON weapon classes. I suppose if it doesn't someone can look into the code and figure out how to make it for all classes. For example you can do: "rhs_m4_acog" call BIS_fnc_weaponAddon; and it returns "rhsusf_c_weapons" which is one of the Addons/Configs from RHS. So expanding on this seems like it could be done. But probably easier way. Share this post Link to post Share on other sites