KokaKolaA3 394 Posted January 5, 2016 Hi, is it possible to have only 1 Bullet in each Magazine, i do not want to place a script in each Weapon or Magazine, so the script has to detect if a Blufor unit has a ASP- 1 Kir "srifle_DMR_04_F" and has the classname of the magazine "10Rnd_127x54_Mag", and then you only have 1 bullet in each magazine for ONLY this rifle. And maybe is it possible to make the rifle not deadly so you will not recieve any damage and play a animation to the player who is hit by the weapon? I want to make a Middle-Range Weapon which shoots rubber bullets and if you hit a person, the person will be fall down(<---Animation). It would be cool if someone can help me ^^ best regards! Share this post Link to post Share on other sites
Lala14 135 Posted January 5, 2016 try this, designed for init.sqf needs a waitUntil {!isNull player}; before it though to make sure it executes correctly. if (side player isEqualTo west) then { while {alive player} do { if (vehicle player isEqualTo player) then { if (currentWeapon player isEqualTo "srifle_DMR_04_F") then { if (currentMagazine player isEqualTo "10Rnd_127x54_Mag") then { if (player ammo currentWeapon player > 1) then { player setAmmo [currentWeapon player, 1]; }; }; }; }; sleep 0.01; }; player addEventHandler ["Respawn",{ while {alive (_this select 0)} do { if (vehicle player isEqualTo (_this select 0)) then { if (currentWeapon (_this select 0) isEqualTo "srifle_DMR_04_F") then { if (currentMagazine (_this select 0) isEqualTo "10Rnd_127x54_Mag") then { if ((_this select 0) ammo currentWeapon (_this select 0) > 1) then { (_this select 0) setAmmo [currentWeapon (_this select 0), 1]; }; }; }; }; sleep 0.01; }; }]; };however, just going over it now you may want it that if a player buys/gets a 10rnd Mag that instead it will split it off into 10 1Rnd Mags, which would kind of change this script in a way.Also it actually turns out that if we were to do that it would probably not work as it still has the weight of a full mag. Share this post Link to post Share on other sites
KokaKolaA3 394 Posted January 6, 2016 That helps me thank you! Share this post Link to post Share on other sites
Guest Posted January 6, 2016 Instead of messing with useless infinite loops... https://community.bistudio.com/wiki/addMagazine_array You can chose the ammo count with this cmd. ;) @lala14 You have done scripts but you are still using such loops ? Okay. Share this post Link to post Share on other sites