Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
_hasItem = "ItemIdHere" in magazines player;
if (_hasItem) then {
s_player_some_action = player addAction[("Some Action"), "path\to\action_script.sqf", ["args","to","pass","to","action","script"], 0, false, true, "", ""];
} else {
player removeAction s_player_some_action;
s_player_some_action = -1;
};
// top of action_script.sqf
private ["_foo"];
_foo = "bar"
player removeAction s_player_some_action;
s_player_some_action = -1;
// logic that performs the action you want done.
class ItemActions {
class Pitch {
text = $STR_PITCH_TENT;
script = "spawn player_tentPitch;";
Is there a way to add a function to the scroll wheel that allows you to switch weapons in your backpack without having to open your gear and backpack and doing it that way?
Yeah, that should be pretty easy. Just get the class id of the current weapon, get the class id of the weapon in the backpack, then remove the primary, remove the one the one the backpack, add the id from the backpack to the primary, and then add the one from the primary to the backpack.
Guess you should learn then.
Wow that was kinda cruel.
Not really. Its good advice. You could at least try to do something to give back to the community instead of just coming on here and begging for scripts. That, in my opinion, is lame.
if (("M40A3" in weapons player)) then {
Alright well I've got a script working, however, I have 2 problems. First, this is the line telling it that if I have an M40A3 blah blah blah
Code:if (("M40A3" in weapons player)) then {
Obviously this means that anybody who gets an M40A3 will get the weapon change option and get another weapon for free so how can I tell it to not only check if it has that one weapon in my hands, but the other weapon that I'm switching to is in my backpack? Second, I can remove one gun from my hands and change it to the other, but what's the command to put the original gun in my backpack?
Guess you should learn then.
Wow that was kinda cruel.
(configFile >> 'cfgWeapons' >> (currentWeapon player)) I think
Edit: This will read for pistols / others weapons as well, not just primary weapons like the DMR
Doesn't that just check in the current weapons, not what's in the backpack?
Doesn't that just check in the current weapons, not what's in the backpack?
Still can't get anything to work for the backpack. I've tried addWeaponCargo, addWeaponCargoGlobal, and clearWeaponCargo and none of them do anything. Any ideas?
Doesn't work either. I'm done for the night. Hopefully KungFuCharlie knows a way.idk try cfgBackpack or something. No clue man. I've already exhausted my minute cache of information
Doesn't work either. I'm done for the night. Hopefully KungFuCharlie knows a way.