schulz 10 Posted July 19, 2004 Hello does exist a script with that you have endless ammo??? THX C Ya Share this post Link to post Share on other sites
Skul 0 Posted July 19, 2004 Just create a script with the following: ammo.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#ammo guy1 addmagazine "magazinetype" ~60 goto "ammo" guy1, magazinetype and 60 can be changed to suit. There is probably a better script out there that detects the type of weapon the unit is carrying, then adds a magazine when it detects the the unit empties a clip. But that should do you good. Thing is, it adds a magazine in every empty item space, so when you throw a grenade, for example, you'll end up with one more magazine than the standard, and another, and so on until all the empty spaces have been used up. [Gareth Gates must die] Share this post Link to post Share on other sites
schulz 10 Posted July 20, 2004 THX this is very helpfully H.A.N.D. Share this post Link to post Share on other sites
Sniper_Kyle 0 Posted July 20, 2004 well that just gives him a mag every 60 seconds, I was just wondering, if there is a way you could determine how many times the guy has shot, and then give him a new mag.... I know it IS possible just not sure how....it would have to be kind of like... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> infbullets.sqs _guy = _this select 0 _magtype = _this select 1 _bulletsinmag = _this select 2 _shell = _this select 3 _shellcount = _shell+1 _guy addeventhandler ["FIRED", {_shellcount}] #checkloop ? shell==_bulletsinmag : goto "newmag" ~.5 goto "checkloop" #newmag _guy addmagazine _magtype And the script would be called like [name of dude,name of mag(in quotations),how many bullets are in that mag] exec "infbullets.sqs" I doubt that this script will be right because I havent scripted in like a year and I have to start at the basics again Share this post Link to post Share on other sites
schulz 10 Posted July 21, 2004 yeeah THX for this H.A.N.D. Share this post Link to post Share on other sites
Sniper_Kyle 0 Posted August 3, 2004 So...did my little snippet work or not? I have not tested it and would like to know if i should edit it more or not Share this post Link to post Share on other sites
hardrock 1 Posted August 3, 2004 I'd do it this way: fInfiniteAmmo.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_this","_ammo"]; _ammo = (_this select 0) ammo (_this select 1); if (_ammo==1) then { (_this select 0) addMagazine (_this select 1); }; true init of anything on the map: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fInfiniteAmmo = loadFile "fInfiniteAmmo.sqf" init of every unit that should have infinite ammo: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["fired",{_this call fInfiniteAmmo}] NOTE: both lines can be present in the same init line (with a semicolon in between), but the first line should be present only once on the map. This snippet will add a magazine to the player once he's fired his last round of a magazine. That counts for any weapon (also grenades, handguns). Share this post Link to post Share on other sites
Blanco 0 Posted August 4, 2004 Brilliant, hardrock! Just what I need! Share this post Link to post Share on other sites
Blanco 0 Posted August 5, 2004 Tested,... It didn't not work always. It worked most of the time for the M16, M60,M21, but not for the nades, G36, M16 grenadelauncher...etc.. It's really hard to trace hte bug when it only works sometimes. Share this post Link to post Share on other sites