Jump to content

Cryonic.

Member
  • Content Count

    25
  • Joined

  • Last visited

  • Medals

Posts posted by Cryonic.


  1. 37 minutes ago, pierremgi said:

    in initPlayerLocal.sqf

     

    player addAction ["Deploy Rally Point", { wsquadRP1 SetPos (player modeltoworld [0,3,0])}
      ,"",1.5,false,true,"","_this == leader group _this && ((units group _this) findIf {_x distance _this < 15}) > -1 "];

     

     Nothing more.

    Thanks for the reply! Do you know how I could prohibit it from working if an enemy is within 50m?


  2. I'm trying to create a rally point system that is similar to Squad's, where only the squad leader can place down a rally point if they have at least one squad member in their vicinity and there are no enemies within 50m.

    So far, I have it that the squad leader (wsl1) can only place down a rally (wsquadRP1) if they have more than 0 players in their vicinity.

    I'd like to limit the nearEntities within 15m to only players in the same group as the squad leader and I think I can use that same method but for detecting if enemies are within 50m, but I'm not sure how.

    All assistance is greatly appreciated.

    waitUntil {!isNull player};
    
    _unit = _this select 0;
    
    if (wsl1 == _unit) then {_unit addAction ["Deploy Rally Point","_num = player nearEntities ['Man',15];
     if(count _num >0) then {wsquadRP1 SetPos (player modeltoworld [0,3,0])} 
      else {hint 'You need at least one squad member nearby to deploy a Rally Point'}","",1.5,false,true,"","_this == _target"];};

     


  3. Bloody Bayonet Gaming is an Arma 3 unit that gets together on Friday & Saturday nights to chill out and play custom missions and scenarios that are made by our members. We usually play as the USMC, US Army, Takistani Militia, or Russian forces. We all like to have a good time and we don't hardcore simulate or roleplay. We are currently trying to get more people so that we can conduct bigger and more complex missions. It doesn't matter if you're already in unit because you can be a member of three units at any given time. If you're interested in being a part of these events then contact me (Cryonic) on Steam and I will get you the mod list we use and get you on our TeamSpeak server. Thank You.


  4. 11 hours ago, davidoss said:

    delete onPlayerRespawn.sqf

     

    method 1:

    create initPlayerLocal.sqf in mission root

    paste this there:

     

    
    player addEventHandler ["Respawn",{
    
    	0 = [_this select 0, _this select 1] spawn {
    	
    		params [["_player",objNull,[objNull]], ["_body",objNull,[objNull]]];
    				
    		[_body] joinSilent grpNull;
    		hideBody _body;
    		waitUntil {sleep .2; alive _player};
    		
    		_uniform = uniform _player;
    
    		switch _uniform do {
    		
    			case "rhsgref_uniform_woodland" : {0 = [_player] execVM "medic.sqf"};
    			case "rhsgref_uniform_og107_erdl" : {0 = [_player] execVM "grenadier.sqf"};
    			case "rhsgref_uniform_woodland_olive" : {0 = [_player] execVM "marksman.sqf"};
    			case "rhsgref_uniform_olive" : {0 = [_player] execVM "autorifleman.sqf"};
    			case "rhsgref_uniform_og107" : {0 = [_player] execVM "squadleader.sqf"};
    			default {};
    		};
    	};
    }];

    method 2:

    use init.sqf paste this there :

    
    if(hasInterface) then {
    
    player addEventHandler ["Respawn",{
    
    	0 = [_this select 0, _this select 1] spawn {
    	
    		params [["_player",objNull,[objNull]], ["_body",objNull,[objNull]]];
    				
    		[_body] joinSilent grpNull;
    		hideBody _body;
    		waitUntil {sleep .2; alive _player};
    		
    		_uniform = uniform _player;
    
    		switch _uniform do {
    		
    			case "rhsgref_uniform_woodland" : {0 = [_player] execVM "medic.sqf"};
    			case "rhsgref_uniform_og107_erdl" : {0 = [_player] execVM "grenadier.sqf"};
    			case "rhsgref_uniform_woodland_olive" : {0 = [_player] execVM "marksman.sqf"};
    			case "rhsgref_uniform_olive" : {0 = [_player] execVM "autorifleman.sqf"};
    			case "rhsgref_uniform_og107" : {0 = [_player] execVM "squadleader.sqf"};
    			default {};
    		};
    	};
    }];
    };

     

    example medic.sqf:

    
    	params [["_player",objNull,[objNull]]];
    	
    	removeAllWeapons _player;
    	removeAllItems _player;
    	removeAllAssignedItems _player;
    	removeUniform _player;
    	removeVest _player;
    	removeBackpack _player;
    	removeHeadgear _player;
    	
    	_player forceAddUniform "rhsgref_uniform_woodland";
    	_player addVest "CUP_V_RUS_Smersh_1";
    	for "_i" from 1 to 8 do {_player addItemToVest "CUP_30Rnd_556x45_Stanag";};
    	_player addBackpack "CUP_B_AlicePack_Khaki";
    	for "_i" from 1 to 35 do {_player addItemToBackpack "ACE_fieldDressing";};
    	for "_i" from 1 to 20 do {_player addItemToBackpack "ACE_epinephrine";};
    	for "_i" from 1 to 20 do {_player addItemToBackpack "ACE_tourniquet";};
    	for "_i" from 1 to 20 do {_player addItemToBackpack "ACE_morphine";};
    	_player addItemToBackpack "ACE_surgicalKit";
    	for "_i" from 1 to 4 do {_player addItemToBackpack "ACE_salineIV_500";};
    	for "_i" from 1 to 4 do {_player addItemToBackpack "ACE_salineIV_250";};
    	for "_i" from 1 to 4 do {_player addItemToBackpack "ACE_salineIV";};
    	_player addItemToBackpack "ACE_personalAidKit";
    	for "_i" from 1 to 35 do {_player addItemToBackpack "ACE_packingBandage";};
    	for "_i" from 1 to 35 do {_player addItemToBackpack "ACE_quikclot";};
    	for "_i" from 1 to 35 do {_player addItemToBackpack "ACE_elasticBandage";};
    	_player addItemToBackpack "ACE_EarPlugs";
    	_player addHeadgear "CUP_H_USArmy_Helmet_M1_m81";
    
    	_player addWeapon "CUP_arifle_M16A2";
    
    	_player linkItem "ItemMap";
    	_player linkItem "ItemCompass";
    	_player linkItem "tf_microdagr";
    	_player linkItem "tf_anprc152_1";

    You need also add some mags

    The script you provided still only works for the server host.


  5. onPlayerRespawn.sqf:
    _uniform = uniform player;
    
    if ("rhsgref_uniform_woodland" isEqualTo _uniform) then {execVM "medic.sqf"};
    if ("rhsgref_uniform_og107_erdl" isEqualTo _uniform) then {execVM "grenadier.sqf"};
    if ("rhsgref_uniform_woodland_olive" isEqualTo _uniform) then {execVM "marksman.sqf"};
    if ("rhsgref_uniform_olive" isEqualTo _uniform) then {execVM "autorifleman.sqf"};
    if ("rhsgref_uniform_og107" isEqualTo _uniform) then {execVM "squadleader.sqf"};
    
    medic.sqf:
    player forceAddUniform "rhsgref_uniform_woodland";
    player addVest "CUP_V_RUS_Smersh_1";
    for "_i" from 1 to 8 do {player addItemToVest "CUP_30Rnd_556x45_Stanag";};
    player addBackpack "CUP_B_AlicePack_Khaki";
    for "_i" from 1 to 35 do {player addItemToBackpack "ACE_fieldDressing";};
    for "_i" from 1 to 20 do {player addItemToBackpack "ACE_epinephrine";};
    for "_i" from 1 to 20 do {player addItemToBackpack "ACE_tourniquet";};
    for "_i" from 1 to 20 do {player addItemToBackpack "ACE_morphine";};
    player addItemToBackpack "ACE_surgicalKit";
    for "_i" from 1 to 4 do {player addItemToBackpack "ACE_salineIV_500";};
    for "_i" from 1 to 4 do {player addItemToBackpack "ACE_salineIV_250";};
    for "_i" from 1 to 4 do {player addItemToBackpack "ACE_salineIV";};
    player addItemToBackpack "ACE_personalAidKit";
    for "_i" from 1 to 35 do {player addItemToBackpack "ACE_packingBandage";};
    for "_i" from 1 to 35 do {player addItemToBackpack "ACE_quikclot";};
    for "_i" from 1 to 35 do {player addItemToBackpack "ACE_elasticBandage";};
    player addItemToBackpack "ACE_EarPlugs";
    player addHeadgear "CUP_H_USArmy_Helmet_M1_m81";
    
    player addWeapon "CUP_arifle_M16A2";
    
    player linkItem "ItemMap";
    player linkItem "ItemCompass";
    player linkItem "tf_microdagr";
    player linkItem "tf_anprc152_1";

    This script is only working locally and not for other players in the server.

    It is used to restock a player's loadout when they respawn.

    I'm pretty new to sqf so I really appreciate any help I receive.

    Thanks!


  6. Hello everyone, I thank you all for helping me create script for a safe zone. Through the past few days I've tested several different scripts that were sent to me, but unfortunately, none of them were fully successful. Until now! Through the help of someone who has much experience and is very talented at coding, we were able to create a script for a safe zone that works 100%. Once again, thanks to everyone who participated in this thread.

     

    Safe Zone Script:   (place in mission's init.sqf file) (create two markers labeled "blufor_safe_zone" & "opfor_safe_zone" (-quotations))

     

    0 = [] spawn {
    _safeZones = [["blufor_safe_zone", west], ["opfor_safe_zone", east]];
    while {true} do {
    {
    _unit = _x;
    _exit = true;
    {
    _unitSide = side _unit;
    if(_unit inArea (_x select 0) && _unitSide isEqualTo (_x select 1) || _unitSide isEqualTo civilian) exitWith {
    _exit = false;
    _unit allowDamage false;
    };
    }forEach _safeZones;
    
    if(_exit) then {
    _unit allowDamage true;
    };
    }forEach (allUnits + vehicles);
    sleep 1;
    };
    };

     


  7. I've been given a new script but it only protects opfor's side.

    //Untested script.
    0 = [] spawn {
    	//[[Marker Name, Side], [Marker Name, Side], etc...]
    	_safeZones = [["blufor_safe_zone", west], ["opfor_safe_zone", east]];
    	while {true} do {
    		{
    			//stores the current marker name
    			_markerName = _x select 0;
    			//stores the current marker side
    			_markerSide = _x select 1;
    			{
    				//see if unit/vehicle position is in the area of the marker
    				if((position _x) inArea _markerName) then {
    					//comparing the unit/vehicle side to the current marker side. will also protects empty vehicles
    					if((side _x) == _markerSide || (side _x) == civilian) then {
    						//if unit side belongs to zone side
    						_x allowDamage false;
    					}else{
    						//if unit side does not belong to zone side
    						_x allowDamage true;
    					}
    				}else{
    					//if unit isn't in zone
    					_x allowDamage true;
    				}
    			}forEach (allUnits + vehicles);
    		}forEach _safeZones;
    		sleep 1.0;
    	};
    };

    Anyone know why this would be?


  8. This code makes it so all players and vehicles in the area take no damage and it works.

    But, I still need a few things from it.

    1. I'd like the code to only affect players of a single side in the area. (i.e. Bluefor or Opfor)

    2.I need a second safe zone in the script for Opfor.

    Thanks.

    0 = [] spawn { 
        while{true} do { 
            { 
                if(_x distance (getMarkerPos "bluefor_safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
            } forEach allUnits + vehicles; 
            sleep 1; 
        }; 
    };

     


  9. I am currently using the below script as a safe zone, where players and vehicles do not take damage, for Bluefor's deployment and it works fine, but I'm trying to find a way for only that specific side to be affected and how I can add another safe zone in for Opfor. I put it in my init.sqf file. Please help, I'm new to this. Thanks!

    0 = [] spawn { 
        while{true} do { 
            { 
                if(_x distance (getMarkerPos "bluefor_safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true}; 
            } forEach allUnits + vehicles; 
            sleep 1; 
        }; 
    };

     


  10. I am creating a multiplayer mission and I do not want players or vehicles to take damage in their deployment area. I have already tried creating a trigger and including "player allowDamage false;" and "player allowDamage true;" but it doesn't work very well. I have very little experience in scripting so if you can help me, please be detailed in your explanation. Thanks!

×