Jump to content

Sukkaed

Member
  • Posts

    527
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Sukkaed

  1. Can i limited this to only work on SUVs?

     

    Why not..

     

    local_lockUnlock.sqf

    private ["_vehicle","_status"];
    _vehicle = _this select 0;
    _status = _this select 1;
    _alarmCar = typeOf _vehicle in ["SUV_TK_CIV_EP1","SUV_Blue","SUV_Green","SUV_Yellow","SUV_Red","SUV_White","SUV_Pink","SUV_Charcoal","SUV_Orange","SUV_Silver","SUV_Camo"];
    
    if (local _vehicle) then {
    	if (_status) then {
    		_vehicle setVehicleLock "LOCKED";
    		if (_alarmCar) then {
    			[nil, _vehicle, rSAY, "lock", 20] call RE;
    			player action ["lightOn", _vehicle];
    			sleep 0.5;
    			player action ["lightOff", _vehicle];
    		};
    	} else {
    		_vehicle setVehicleLock "UNLOCKED";
    		if (_alarmCar) then {
    			[nil, _vehicle, rSAY, "lock", 20] call RE;
    			player action ["lightOn", _vehicle];
    			sleep 0.5;
    			player action ["lightOff", _vehicle];
    		};
    	};
    };
    
  2. Good point. Like this?

    if (isnil ("travel")) then {
    	travel = 
    	{
    		_place = _this select 0;
    		_coords = _this select 1;
    		if ("??????" in magazines player) then {
    			player removeMagazine "?????";
    			titleText [format["Flying to %1...",_place],"BLACK OUT",1];
    			sleep 5;
    			player setPosATL _coords;
    			titleText ["","WHITE IN",1];
    			titleText [format["You have arrived to %1!",_place],"PLAIN DOWN"];
    		} else {
    			cutText ["You need ??????? to fast travel!", "PLAIN DOWN"];	
    		};
    	};
    };
    
  3. We could short this all in one file but is it good idea to make any unnecessary public variables?

    travel = 
    {
    	_place = _this select 0;
    	_coords = _this select 1;
    	if ("??????" in magazines player) then {
    		player removeMagazine "?????";
    		titleText [format["Flying to %1...",_place],"BLACK OUT",1];
    		sleep 5;
    		player setPosATL _coords;
    		titleText ["","WHITE IN",1];
    		titleText [format["You have arrived to %1!",_place],"PLAIN DOWN"];
    	} else {
    		cutText ["You need ??????? to fast travel!", "PLAIN DOWN"];	
    	};
    };
    travelmenu =
    [
        ["",true],
            ["Choose Your Destination:", [-1], "", -5, [["expression", ""]], "1", "0"],
                ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    			["Bash Trader", [2],  "", -5, [["expression", "['Bash Trader',[4018.4233, 11678.521, 0.02]] spawn travel"]], "1", "1"],
    			["Klen Trader", [3],  "", -5, [["expression", "['Klen Trader',[11396.401, 11368.146, 0.02]] spawn travel"]], "1", "1"],
                ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
    ];
    showCommandingMenu "#USER:travelmenu";
    
  4. It's always good to keep everything short as possible.

    //fn_selfactions
    if (cursorTarget isKindOf "??????" and (player distance cursorTarget) < 5) then {
    	if (s_player_travel < 0) then {
        	s_player_travel = player addaction ["Fast Travel","travel_menu.sqf","",5,false,true,"", ""];
        };
    } else {
    	player removeAction s_player_travel;
    	s_player_travel = -1;
    };
    
    
    //travel_menu.sqf
    travelmenu =
    [
        ["",true],
            ["Choose Your Destination:", [-1], "", -5, [["expression", ""]], "1", "0"],
                ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    			["Bash Trader", [2],  "", -5, [["expression", "['Bash Trader',[4018.4233, 11678.521, 0.02]] execVM 'fast_travel.sqf'"]], "1", "1"],
    			["Klen Trader", [3],  "", -5, [["expression", "['Klen Trader',[11396.401, 11368.146, 0.02]] execVM 'fast_travel.sqf'"]], "1", "1"],
                ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
    ];
    showCommandingMenu "#USER:travelmenu";
    
    
    //fast_travel.sqf
    _place = _this select 0;
    _coords = _this select 1;
    
    if ("??????" in magazines player) then {
    	player removeMagazine "?????";
    	titleText [format["Flying to %1...",_place],"BLACK OUT",1];
    	sleep 5;
    	player setPosATL _coords;
    	titleText ["","WHITE IN",1];
    	titleText [format["You have arrived to %1!",_place],"PLAIN DOWN"];
    } else {
    	cutText ["You need ??????? to fast travel!", "PLAIN DOWN"];	
    };
    
  5. When i added this part to my Description.ext it stuffed up my server and it just said waiting for host.. i added it in the correct spot and all.. 

     

    Looks good to me. Are you sure that you didn't have CfgSounds class already? Can you post your whole description.ext.

  6. You're missing some brackets but not sure would it still work. Try this.

    _random = round(random(2));
    
    switch (_random) do {
    case 0: 
        {
        DefaultMagazines = ["8Rnd_9x18_Makarov","8Rnd_9x18_Makarov","ItemBandage","ItemBandage","ItemMorphine","FoodCanPasta","ItemSodaMdew","ItemPainkiller"];
        DefaultWeapons = ["ItemFlashlightRed","ItemMap","ItemCompass","Makarov"];
        DefaultBackpackWeapon = "";
        };
    
    case 1:
        {
        DefaultMagazines = ["8Rnd_9x18_MakarovSD","8Rnd_9x18_MakarovSD","FoodCanFrankBeans","ItemMorphine","ItemBandage","ItemBandage","ItemSodaPepsi","ItemPainkiller","ItemMorphine"];
        DefaultWeapons = ["ItemFlashlightRed","ItemMap","MakarovSD"];
        DefaultBackpackWeapon = "";
        };
    
    case 2:
        {
        DefaultMagazines = ["10x_303","10x_303","FoodCanSardines","ItemSodaCoke","ItemMorphine","ItemBandage","ItemBandage","ItemPainkiller"];
        DefaultWeapons = ["ItemFlashlightRed","ItemMap"];
        DefaultBackpackWeapon = "LeeEnfield";
        };
    };
    
  7. is it possable for dzai  air veh Ka137_PMC when spawned start a siren sound while it patrols? 

     

    Should be. Find where it's spawned and add something like this.

    //_vehicle = whatever variable is used to spawn it
    while {alive _vehicle} do {
        [nil, _vehicle, rSAY, "siren", 120] call RE;
        sleep 5;
    }:
    
  8.  

    figured this would work but not. Trying to get //Sirens  and //Siren Airraid working but no luck

     

     

    You can't use same variable for both addactions. Try this.

    _isCopcar = typeOf _vehicle in ["SUV_UN_EP1","LadaLM","policecar","M113Ambul_UN_EP1","Mi17_UN_CDF_EP1"];
    _isCopcar2 = typeOf _vehicle in ["BMP2_UN_EP1","Ural_UN_EP1","M113_UN_EP1"];
     
    if (_inVehicle and (driver _vehicle == player)) then {
        dayz_addsirens = _vehicle;
        if (_isCopcar) then {		
            if (s_player_sirens_on < 0) then {
                s_player_sirens_on = dayz_addsirens addAction ["Siren on","Scripts\sirens\sirens_on.sqf",dayz_addsirens,2,false,true,"",""];
    	    s_player_sirens_off = dayz_addsirens addAction ["Siren off","Scripts\sirens\sirens_off.sqf",dayz_addsirens,2,false,true,"",""];
    	};
        };
        if (_isCopcar2) then {
    	if (s_player_sirens_on2 < 0) then {
                s_player_sirens_on2 = dayz_addsirens addAction ["Siren on","Scripts\sirens\sirens_on2.sqf",dayz_addsirens,2,false,true,"",""];
                s_player_sirens_off2 = dayz_addsirens addAction ["Siren off","Scripts\sirens\sirens_off2.sqf",dayz_addsirens,2,false,true,"",""];
            };
        };
    } else {
        dayz_addsirens removeAction s_player_sirens_on;
        dayz_addsirens removeAction s_player_sirens_off;
        dayz_addsirens removeAction s_player_sirens_on2;
        dayz_addsirens removeAction s_player_sirens_off2;
        s_player_sirens_on = -1;
        s_player_sirens_off = -1;
        s_player_sirens_on2 = -1;
        s_player_sirens_off2 = -1;
    };
    
  9. Got a problem with this script. Players can Click Harvest repeatedly and fill their inventory up with 1200 KiLOs of Hemp. Going to have to take it out of my server until I can or someone else posts a fix. Anyone else have this issue?

     

    You could set a limit to how many hemps can be in the main inventory at once.

    _hempqty = {_x == "ItemKiloHemp"} count magazines player;
    
    if (_hempqty > 9) exitWith { 
        cutText [format["WARNING: %1, You have maximum amount of weed in your inventory!", name player], "PLAIN DOWN"];
    };
    
×
×
  • Create New...