Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

samatra

Member
  • Content Count

    652
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by samatra

  1. { if(isPlayer _x) then { private ["_cnt", "_plr"]; _plr = _x; _cnt = 0; { if(isPlayer _x) then { _cnt = _cnt + 1; }; } forEach nearestObjects [_x, ["Man"], 50]; hint format ["%1 players around %2", (_cnt - 1), name _plr]; }; } forEach allUnits; Didn't actually test the code, but it should work. This cycles through all players and counts players around them and puts number into _cnt. It will include player himself (so it is _cnt - 1 players around him). 50 is radius to check around each player.
  2. Hello. Is there any way to check if user has scoreboard open? (the one you have by pressing "i") Maybe you can somehow get it with findDisplay? Thanks.
  3. samatra

    Civilian question

    You can also use isKindOf. According to vehicle class tree womans can be checked with if((_x isKindOf "Woman") || (_x isKindOf "Woman_EP1")) then { //Females } else { //Males }
  4. You should know the difference between setPos, setPosATL and setPosASL, since you use ATL this will mean that any invisible ground elevation under building will move your weaponholder position accordingly, i would recommend you to spawn weaponholders relative to building position\elevation, not relative to terrain level. Also I would recommend you to use createVehicle array instead of old deprecated way of creating vehicles you use right now, to be more specific you might want to experiment with different "special" parameters of newly created vehicle (Should be CAN_COLLIDE i think). Also take a look at http://community.bistudio.com/wiki/modelToWorld and http://community.bistudio.com/wiki/worldToModel, this might help you creating predefined spots for weapon holders for each building class. Edit: Here is my loot position generation mission I used for myself, basically it creates loot spots relative to building and dumps them into ArmA2OA.RPT (delete "# and #" in dump to get array of loot positions), scripts are bit messy but maybe you will find it useful.
  5. No, there is no way around that without altering model which is impossible since models are closed for modifications and you will need a mod for that
  6. samatra

    Macro issues

    Shouldn't it be like #define __ccppfln(file) call compile preprocessFileLineNumbers "file" ?
  7. Either you got lite texture (PMC, BAF) or did something wrong. Yesterday I unpacked SUV texture and it was 4 megabytes in size.
  8. Just use original textures as an example (extract them using Bitools).
  9. You can't compare arrays with == and others, you will have to walk through each array item and compare it by yourself.
  10. Add into each player unit init: this addMPEventHandler ["MPRespawn", {h1pilots = h1pilots + [_this select 0];}];
  11. Something like this in init.sqf: p2 addMPEventHandler ["MPRespawn", {h1pilots = h1pilots + [_this select 0];}]; Add this for each player unit.
  12. You probably need to add newly spawned unit into h1pilots Add event handler for respawn and add new unit into this array.
  13. Make a cycle of walking through all vehicles, delete old marker (store marker name\id\number with setVariable), add new local marker. Something like that.
  14. 1) Use if(!isServer) exitWith {}; this will exit activation script if player is not server and will execute it on server only The main thing that you should know is Multiplayer Locality, always check if certain command executes only on one machine or all clients before using it and adjust your scripts accordingly.
  15. There was hunting mission by Xeno where you hunt various animals and gain points (and you can also hunt other hunters), don't remember its name though.
  16. Hello. I stumbled upon several announcements about publicVariableServer command which syncs variable only with server which will be extremely useful for my mission. I've tried it and it looks like command doesn't exists in last beta build, was it revoked or I'm doing something wrong? There is also barely any mention about this command apart from dayz change logs copy-pasted all over the internet. I will really appreciate if somebody could explain what is going on. Thank you.
  17. This thread needs a bump. I will really appreciate an answer. Thank you.
  18. "f8580f00# 8335: datsun02t.p3d" IS reference to vehicle object, it is just what object->string conversion returns.
  19. Tested it, it creates a reference, not copies array itself. Thanks for help.
  20. I'm wondering if I will have another array as part of other array, will it copy first array or just leave a link\reference to second array? For example hugeArray1 = [ ... ]; mySmallArray1 = ["hurr", hugeArray1]; mySmallArray2 = ["durr", hugeArray1]; Will I have copies of hugeArray1 inside mySmallArray1 (and mySmallArray2) or it will be just a link to that array and if I will change something in hugeArray1 will this change by accessible through mySmallArray1? Thank you.
  21. Hello. How can I check if there are any players are nearby certain position? And I mean players only, not AI. Thanks.
  22. samatra

    Drag Carry Ammobox

    Take a look at this: http://forums.bistudio.com/showthread.php?94280-R3F-Artillery-and-Logistic-Manual-artillery-and-advanced-logistic-(mission-script) This script includes ability to move objects and even put them inside vehicles. Has lots of configuration options. Oh and about KeyDown stuff, sometimes findDisplay doesn't return display properly and you can't (obviously) add event handlers to it. Here is how I solve this problem: [] spawn { private ["_display"]; _display = null; disableSerialization; while {true} do { _display = findDisplay 46; if(!isNull(_display)) exitWith {}; sleep 1; }; _display displaySetEventHandler ["KeyDown", "hint ""KeyDown"";"]; }; It basically tries to get display indefinitely each second until it finds it and adds event handler
×