Jump to content

lmapper

Member
  • Posts

    180
  • Joined

  • Last visited

Posts posted by lmapper

  1. Add this line to description.ext:

    #include "PATHTOFILE\cfgServerTrader.hpp"
    
    

    Add this to init.sqf:

    DZE_ConfigTrader = true; // Config traders instead of DB
    
    

    Add files to mission folder.

    cfgServerTrader.hpp himself appears, or i need to create it?

  2. If you are running this from the server it probably is working but the effect is only local. Try running it as a player and apply it to another player / agent that you can see in game. Even then not 100% sure, I haven't tested it.

    Why ? How i can use it right ?

    its just like custom loadout script.

  3. Code does not work, the message is not displayed with any UID.

     

    Init.sqf :

    [] execVM "compile\Server_TeaRandomFaces.sqf";

    Server_TeaRandomFaces.sqf :

    if (!(getPlayerUID player) in ["160618674"]) then 
    {
        _rnd = random 100;
        _sel = format ["face%1", _rnd];
        player SetFace _sel;
        hint "Message";
    };
  4. As long as _lifts is local to the script and within scope, this should work.

    {
    	if (((getPosASL player) distance _x) < 15) then {
    		diag_log format ["Lift Found: %1", str(_x)];
    	};
    } forEach _lifts;
    

    Should log if you are within 15meters.

     

    Dont Work :(   ( juft dont write in log ).

    private ["_lifts",
    _lifts = 
    [
    [6326.97,7808.91,0], // 0
    [4062.94,11665.5,0], // 1
    [11447.8,11364.5,0]  // 2
    ];
    {
    if (((getPosASL player) distance _x) < 15) then {
    diag_log format ["Lift Found: %1", str(_x)];
    };
    } forEach _lifts;
  5. Check your dayz_mission/init.sqf for:

    	[] ExecVM "Scripts\loadout.sqf";
    

    and

    DefaultMagazines = ["ItemBandage","ItemBandage","ItemPainkiller","FoodCanSardines","ItemWaterbottle","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD"];
    DefaultWeapons = ["Itemtoolbox","ItemMap","ItemHatchet_DZE","ItemCompass","ItemKnife","M9SD"];
    DefaultBackpack = "DZ_Patrol_Pack_EP1";
    DefaultBackpackWeapon = "";
  6. But you also don't use exitWith here as it exits out of the forEach, making it pointless.

     

    I think it makes sense to use exitWith here.

    I need to find out whether the near-Player elevator.

    Next to the player can be only one elevator, so I do not see any reason to continue the cycle.

    (Do not pay attention to the messages for logging, it seems they have introduced you astray.)

     

    I use "else..." only for testing.

  7. Why it doesnt work in fn_selfActions.sqf ?

    RPT havent error messages and dial_log messages.

    {
    	if (player distance _x > 15) then 
    	{
    		exitWith {diag_log format ["Lift %1, sucess find", _x];
    	};
    	else 
    	{
    	exitWith {diag_log format ["Lift not found: %1", _x];
    	};
    } forEach _lifts;
    
    
  8. When using a forEach you don't increment the _x nor do you use the variable name you have in the first line...

     

    This part is killing any chance you are reading the list properly

     

    player distance _lifts[_x] > 3

    should be

    player distance _x > 3

     

    And remove the _x++ you have. It is not a count value, it is the actual entry from the array. forEach handles the parsing of your array and uses an internal counter.

     

    Your also using the wrong variable in the forEach loop, with the second method you don't even need _numlifts at all. If you need how many is in the array use 'count'.

     

    } forEach _numlifts;

    should be

    } forEach _lifts;

     

    BTW method 1 is skipping array entry 0 since your loop starts at 1. Also using 'step 1' isn't necessary since a for loop defaults to a step size of 1.

     

    EDIT

    Found another issue, you need to remove the quotes out of the array. Using quotes makes it string entries, not number arrays.

  9. I came up with two options, but both do not work. Error in writing, or logical error?

    Please help with some of the options.

     

     

    Basics:

    private ["_numlifts","_lifts"];
    
    _numlifts = 3;
    _lifts = 
    [
    "[6326.97,7808.91,0]",
    "[4062.94,11665.5,0]",
    "[11447.8,11364.5,0]"
    ]// Change "_numlifts" when add new lifts !
    

    Option 1:

    for "_i" from 1 to _numlifts step 1 do {
    if (player distance (_lifts select _i) < 3)
    {
    exitWith {diag_log format ["Sucessful find lift: %1", _i]};
    }
    else {diag_log"Lift %1 is'nt found.", _i};
    };

    Option 2:

    {if (player distance _lifts[_x] > 3) then 
    {
    exitWith {diag_log format ["Lift %1, not found", _x];
    _x++;
    };
    else 
    {
    exitWith {diag_log format ["Sucessful find lift: %1", _x];
    };
    } forEach _numlifts;
×
×
  • Create New...