callihn 10 Posted September 13, 2010 (edited) I seem to be doing something wrong with this, it seemed like a simple command replacement, but it's not working so I must be missing something. Here is what I have in init.sqf: (getPos this nearestObject 224602) allowdamage false; Could someone point out what I am doing wrong here please? Thanks Edited October 13, 2010 by callihn Share this post Link to post Share on other sites
kylania 568 Posted September 13, 2010 If it's in init.sqf you'll need to use the name of some object instead of this. Share this post Link to post Share on other sites
callihn 10 Posted September 13, 2010 (edited) If it's in init.sqf you'll need to use the name of some object instead of this. Thanks, but I can't name the object it's in the map, otherwise I could have just placed it in it's init. So are you saying that we can't set a building in the map to not accept damage? Edited September 13, 2010 by callihn Share this post Link to post Share on other sites
neokika 62 Posted September 13, 2010 Thanks, but I can't name the object it's in the map, otherwise I could have just placed it in it's init.So are you saying that we can't set a building in the map to not accept damage? No, he is just saying that what you have wont work in the ini.sqf. You have this, and this does not exist in the init.sqf. You need to use the position like: ([x, y, z] nearestObject 224602) allowdamage false; _neo_ Share this post Link to post Share on other sites
kylania 568 Posted September 13, 2010 Yeah, either use a specific position like neo said, or put a gamelogic on the map somewhere called server or something and use this: (getPos server nearestObject 224602) allowdamage false; Share this post Link to post Share on other sites
f2k sel 164 Posted September 13, 2010 Actually it works fine in the init for me. (getpos this nearestObject 5169) allowdamage false; or name a game logic say GL (getpos GL nearestObject 5169) allowdamage false Worth noting that when you restart the map it remembers it's previous true false damage state. I actually wouldn't use the ID number as they have changed from time to time and it makes it a pain moving things around. I use this placed in a game logic, the advantage is you can protect lots of buildings or just one depending on the radius. You can also protect other things than just the building bu using the filter. Protects everything withn 8 meteres obj = nearestobjects [GL,[], 8];{_x allowdamage false } foreach obj; This would protect men and vehicles ect. obj = nearestobjects [GL,["men","vehicle"], 8];{_x allowdamage false } foreach obj; I have notice if there ar alot of men around an explosion some may still get killed. Share this post Link to post Share on other sites
callihn 10 Posted September 13, 2010 (edited) Thanks everyone, is there some code I could stick in my players init to display his current position for something like this or? Edited September 13, 2010 by callihn Share this post Link to post Share on other sites
neokika 62 Posted September 13, 2010 Thanks everyone, is there some code I could stick in my players init to display his current position for something like this or? Yes, In this case lets use a hint and copy the position to the clipboard: _pos = getPos this; hint format ["Position:%1", _pos]; copyToClipBoard _pos; Share this post Link to post Share on other sites
callihn 10 Posted September 13, 2010 Thanks, I see that [0,0,0] works, so I'll just use that, unless there is some reason I shouldn't, but I'm sure that code will come in handy, since it is not the first time I've had a need to display location. if you have several IDs in a row can you do something like this?: ([0,0,0] nearestObject 205680-205700) allowdamage false; Or? Share this post Link to post Share on other sites
kylania 568 Posted September 13, 2010 In ArmA2 there was some bugs if you made items in [0,0,0] so people took to spawn at [1,1,1] instead. :) Share this post Link to post Share on other sites
callihn 10 Posted October 12, 2010 Any ideal why this doesn't work?: mybunker allowdamage false; I of course have an object named mybunker and it's not working. Share this post Link to post Share on other sites