Jump to content

Icaruk

Member
  • Content Count

    217
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Icaruk

  1. I'm trying to do a script that does the following: when you are near obj, you hold it, then it adds an action that allows you to push it away from you, then removing the action. myscript.sqf waituntil {player == player}; _unit = _this select 0; while {true} do { if ((obj distance _unit) < 4) then { obj attachTo [_unit, [0,1.2,0.4]]; _unit addAction ["<t color='#FF0000'>PUSH OBJ</t>", "detach obj, removeAllActions _unit, obj setvelocity [10,0,5]", {}]; waituntil {((obj distance _unit) >= 4)}; }; sleep 1; }; Now, there are 3 problems: - I need to push the obj in the direction I'm facing. - I don't know how to put all these things inside the addaction. - I need to run this just on the client that runs the script, not affecting others. Any help?
  2. With the script I posted did that if someone else is near you, the obj will detach and it will attach to the new owner. Any more ideas please?
  3. Icaruk

    LMG question

    https://community.bistudio.com/wiki/Arma_3_CfgMagazines 200Rnd_65x39_Belt_Tracer_Red 200Rnd_65x39_Belt_Tracer_Green 200Rnd_65x39_Belt_Tracer_Yellow
  4. Well, this is the script atm: FNC_chute = { _unit = _this select 0; _obj = (_this select 0) getvariable "object"; _vel = velocity _unit; _dir = direction _unit; if ((speed _unit) < 10) then { _speed = 8; _obj setVelocity [((_vel select 0) - 3) + (sin _dir*_speed),((_vel select 1) - 3) + (cos _dir*_speed),(_vel select 2) + 10]; _unit spawn {sleep 0.3;_this enableCollisionWith (_this getvariable "object");}; }; if (((speed _unit) > 10) and ((speed _unit)) < 20) then { _speed = 8; _obj setVelocity [((_vel select 0) - 1) + (sin _dir*_speed),((_vel select 1) - 1) + (cos _dir*_speed),(_vel select 2) + 2]; _unit spawn {sleep 0.3;_this enableCollisionWith (_this getvariable "object");}; }; if ((speed _unit) > 20) then { _speed = 13; _obj setVelocity [((_vel select 0) + 7) + (sin _dir*_speed),((_vel select 1) + 7) + (cos _dir*_speed),(_vel select 2) + 3]; _unit spawn {sleep 0.3;_this enableCollisionWith (_this getvariable "object");}; }; }; waituntil {player == player}; _unit = _this select 0; //_obj = _this select 1; _obj = cursortarget; _unit setvariable ["object",_obj,true]; while {alive _unit} do { _obj = cursortarget; _unit setvariable ["object",_obj,true]; if ((_obj distance _unit) < 4 and _obj iskindof "thing") then { detach _obj; _obj attachTo [_unit, [0,1.2,0.4]]; _unit addAction ["<t color='#FF0000'>Chutar</t>",{ _obj = (_this select 0) getvariable "object";(_this select 0) disableCollisionWith _obj ;detach _obj;removeAllActions (_this select 0);_this call FNC_chute}]; waituntil {((_obj distance _unit) >= 4 )}; }; hint format ["%1",(speed _unit)]; sleep 1; }; The main problem now is MP related. If I create a game, I run the script and it works nice, but when a second player runs it, he can hold the object, but when he uses the action to push it away, it just does detach. Any ideas?
  5. It works nice, thanks! I'll modify some things then I'll post the final script here ^^
  6. [All maps] - Added 8 seconds of respawn protection (Move the box has just 4). - Tons of small fixes. - Some map enhancements.
  7. I can't test it alone, and I'm not sure if it will affect just to the player that respawned: onPlayerRespawn.sqf _unit = _this select 0; _unit allowdamage false; sleep 5; _unit allowdamage true;
  8. I wanted this, I was confused about the syntax, so I couldn't not write it. Thanks for help guys! <3
  9. So on the unit's init: this addEventHandler ["Respawn", {execVM "myProtectionScript.sqf"}]; myProtectionScript.sqf _unit = _this select 0; _unit allowdamage false; sleep 5; _unit alowdamage false; I'm still with the initial problem xD
  10. When someone dies, he will execute automatically the "onPlayerRespawn.sqf". I'm trying to affect just to the guy that respawns, and not other people.
  11. Oh I totally forgot it >_< thanks!
  12. That's the code I want to run just one time, but the items spawned should be visible for everybody. This works for me on local, and if I create the game (I'm the server), but if I run this on a dedicated server (I'm not the server) no one can see the loot. if (isServer) then { { _mkrcolor = getmarkercolor _x; _num = [0,0,0,1,1,1,1,1,1,2] call BIS_fnc_selectRandom; _num2 = [0,0,1,1,1,1,1,1,2,2] call BIS_fnc_selectRandom; _num3 = [0,0,1,1,1,1,1,1,1,1] call BIS_fnc_selectRandom; switch (_mkrcolor) do { //civ item case "ColorGreen" : { _civ1 = ["FirstAidKit","FirstAidKit","FirstAidKit","Binocular","Rangefinder"] call BIS_fnc_selectRandom; _item1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _item1 addItemcargo [_civ1,_num]; }; //backpacks case "ColorBlue" : { _mochila = ["B_AssaultPack_mcamo","B_AssaultPack_mcamo","B_FieldPack_oucamo","B_FieldPack_oucamo"] call BIS_fnc_selectRandom; _item2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _item2 addBackpackcargo [_mochila,_num3]; }; //normal loot case "ColorBlack" : { _armaN = ["arifle_Katiba_C_F", "arifle_Katiba_C_F", "arifle_Katiba_C_ACO_F", "arifle_Katiba_GL_F"] call BIS_fnc_selectRandom; _arma1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _arma1 addweaponcargo [_armaN,_num]; }; //normal ammo case "ColorWhite" : { _ammoN = ["30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "6Rnd_45ACP_Cylinder", "6Rnd_45ACP_Cylinder"] call BIS_fnc_selectRandom; _ammo1 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _ammo1 addmagazinecargo [_ammoN,_num]; }; //military loot case "ColorRed" : { _armaM = ["srifle_DMR_01_F","LMG_Zafir_F"] call BIS_fnc_selectRandom; _arma2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _arma2 addweaponcargo [_armaM,_num3]; }; //military ammo case "ColorOrange" : { _ammoM = ["10Rnd_762x51_Mag","150Rnd_762x51_Box_Tracer"] call BIS_fnc_selectRandom; _ammo2 = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _ammo2 addmagazinecargo [_ammoM,_num3]; }; //military optics case "ColorPink" : { _opticM = ["optic_ACO_grn","optic_Aco","optic_ACO_grn","optic_Aco","optic_Holosight","optic_Holosight","optic_MRCO","optic_Arco","optic_LRPS","optic_Nightstalker"] call BIS_fnc_selectRandom; _optic = createVehicle ["groundweaponHolder",getMarkerPos _x,[], 0, "can_collide"]; _optic addItemcargo [_opticM,_num3]; }; };} foreach allmapmarkers; };
  13. [steal the quad] - Fixed the timer and other smalls bugs. - Added a small HUD element to show the time you must keep the quads before winning.
  14. Thanks, it worked! I'll take a look to the function viewer ^^
  15. I want to make the following scene: You are on a helicopter, you hear the lock alarm then you see a missile coming to your face, then explodes. Any ideas?
  16. I forgot to mention that I can't spawn a AA unit on the sea :( I haven't found any info about this :/
  17. Icaruk

    !alive Condition Not Working?

    If you have just one condition: !alive sniper1 If you have more than one: !(alive sniper1) AND !(alive sniper2)
  18. Thanks, it worked! I'll leave here a more durable blurry, with this one it's like you start waking up after a explosion or something. [] spawn { addCamShake [20, 20, 0.2]; setCamShakeParams [0, 5, 1, 2, true]; private ["_blur"]; _blur = ppEffectCreate ["DynamicBlur", 474]; _blur ppEffectEnable true; _blur ppEffectAdjust [0]; _blur ppEffectCommit 0; waitUntil {ppEffectCommitted _blur}; _blur ppEffectAdjust [20]; _blur ppEffectCommit 0; _blur ppEffectAdjust [0]; _blur ppEffectCommit 10; waitUntil {ppEffectCommitted _blur}; _blur ppEffectEnable false; ppEffectDestroy _blur; };
  19. Someone knows how to make this blurry vision effect via script? Thanks.
  20. [seek & destroy] - Fixed a timer issue. NEW [steal the quad] - Added to the first post.
  21. I fixed a sync issue 7 days ago, maybe it's fixed now. Btw, you need to push (not pull) the box. If the box stops moving, just move some meters away and try again. Sometimes it's just sync issues :/
  22. [VIP] - Removed the VIP's ability to teleport anywhere on the map (lol).
  23. Thanks for the report! Can you give me more details about "weird"? And yes, maybe it could be for the last patch :/
  24. I use this: Trigger bomb="M_Mo_82mm_AT_LG" createVehicle (getPos Mine01); deletevehicle Mine01; Where M_Mo_82mm_AT_LG you can change it the explosion type here.
×