Jump to content

Andrej

Member
  • Posts

    13
  • Joined

  • Last visited

Posts posted by Andrej

  1. Can someone help me get working this script it does not 'remote control vehicle'
    https://community.bistudio.com/wiki/remoteControl

    private["_player","_vehicle","_ct","_vehicleCt","_driving","_distance"];
    
    _player = player; 
    _ct = cursorTarget;
    _vehicle = "SUV_Camo";
    _vehicleCt = typeOf _ct;
    _distance = _player distance _ct;
    _driving = true;
    StopRemoteSUV = false;
    
    //check distance and vehicle type
    if(_distance > 5) exitWith {cutText ["You must be within 5 meters of the SUV","PLAIN DOWN"];};
    if(isNull _ct || _vehicleCt != _vehicle) exitWith {cutText ["Target is not a SUV.", "PLAIN DOWN"];};
    
    //remote control vehicle
    player remoteControl driver _ct;
    driver _ct switchCamera "internal";
    player remoteControl driver _ct;
    
    //exit remote control if distance from vehicle is > 100 or if you stop it(action menu call global StopRemoteSUV)
    while {_driving} do {
    	if(_distance > 100 || StopRemoteSUV) exitWith {
    		objNull remoteControl driver _vehicle;  // removes the remoteControlling
    		player switchCamera "internal";  // returns to the player
    		cutText ["You lost control of vehicle","PLAIN DOWN"];
    		_driving = false;
    	};
    	sleep 0.1;
    };

     

    Thank you

  2. On 10/2/2014 at 3:40 PM, Rocu said:

    Should be pretty straight forward. For humanity I grabbed the first snipped I could find from the existing Epoch files and got something like this:

    
    _characterID = player getVariable ["CharacterID",0];
    _key = format["CHILD:102:%1:",_characterID];
    _primary = _key call server_hiveReadWrite;
    if (count _primary > 0) then {
    	if ((_primary select 0) == "ERROR") exitWith {
    		//Could not get data
    	};
    };
    _humanity =	_primary select 5;

    No idea if it works or not though, you're going to have to test it out. This particular call (102) also grabs data such as medical status, stats, state, worldspace etc. So I guess there's probably a more discrete way of doing this, but this should work just as fine.

     

    Though I don't see why you need to grab it straight from the database. Most basic info is available through variables:

    
    _humanity = player getVariable ["humanity",0];

    Do you know how to read custom column for database 1.0.6 epoch?

  3. 23 hours ago, juandayz said:

    you can use the time to prevent a second use. but cuz is a client side script, if player disconect and relog again they can use the started box one more time.

    any way:

    starterbox.sqf (mpmissions\your instance\custom\ )

      Reveal hidden contents
    
    
    private ["_LastUsedTime","_Time","_distance","];
    
    _LastUsedTime = 3600;
    _Time = time - lastuse;
    
    
    if(_Time < _LastUsedTime) exitWith { 
        cutText [format["wait %1 seconds !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; 
    }else{
    
    //CREATE THE BOX
    box =
    	{
    		
    _crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
    _crate setpos  (player modelToWorld [0,6,0]);
    _crate setDir ([_crate, player] call BIS_fnc_dirTo);
    clearWeaponCargoGlobal _crate;
    clearMagazineCargoGlobal _crate;
    
    // add weapons
    		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
    		_crate addWeaponCargoGlobal ["ItemEtool", 2];
    		_crate addWeaponCargoGlobal ["ItemCompass", 2];
    		_crate addWeaponCargoGlobal ["Binocular", 2];
    		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
    		_crate addWeaponCargoGlobal ["ItemGPS", 2];
    		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
    		_crate addWeaponCargoGlobal ["ItemKnife", 2];
    		_crate addWeaponCargoGlobal ["ItemMap", 2];
    		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
    		_crate addWeaponCargoGlobal ["ItemWatch", 2];
    		_crate addWeaponCargoGlobal ["NVGoggles", 2];
    		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
    		_crate addWeaponCargoGlobal ["ItemMachete", 2];
    		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
    		_crate addWeaponCargoGlobal ["ItemShovel", 2];
    		_crate addWeaponCargoGlobal ["ItemSledge", 2];
    		_crate addWeaponCargoGlobal ["ChainSaw", 1];
    		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
    	
    	// add items
    	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
    		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
    		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
    		_crate addMagazineCargoGlobal ["MortarBucket", 26];
    		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
    		_crate addMagazineCargoGlobal ["ItemPole", 16];
    		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
    		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
    		_crate addMagazineCargoGlobal ["ItemVault", 2];
    		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
    		_crate addMagazineCargoGlobal ["ItemBandage", 10];
    		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
    		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
    		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
    		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
    	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
    	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
    	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
    	_crate addMagazineCargoGlobal ["PartEngine", 5];
    	_crate addMagazineCargoGlobal ["PartVRotor", 5];
    	_crate addMagazineCargoGlobal ["PartWheel", 24];
    	_crate addMagazineCargoGlobal ["PartGlass", 24];
    	_crate addMagazineCargoGlobal ["PartFueltank", 4];
    	_crate addMagazineCargoGlobal ["PartGeneric", 100];
    	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
    	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
    	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
    	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
    	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
    		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
    	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
    	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
    	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
    	
    	
    
    };
    call box;
    	
    _distance = 100;
    
    waitUntil {(player distance _crate) > _distance};
    deleteVehicle _crate;
    titleText ["started box was deleted","PLAIN DOWN"]; titleFadeOut 4;
    
    };
    

     

    init_starterbox.sqf

      Reveal hidden contents
    
    
    waituntil {!isnull (finddisplay 46)};
    sleep 15;
    startedbox = player addaction [("<t color=""#6599FF"">" + ("StarterBox") +"</t>"),"custom\starterbox.sqf","",5,false,true,"",""]; 

     

    At bottom of init.sqf

    [] ExecVM "custom\init_starterbox.sqf";

    but remember the better way is try to do it throug server side...i guess

    @juandayz Do you may know how to solve this problem if you have time.

     

  4. I'm struggling with database how can i get value from custom column.
    I have create a custom column "Start" inside "character_data" with:
     

    ALTER TABLE `Character_DATA` ADD `Start` INT(1) NOT NULL DEFAULT '1';

    I have tried with:
     

    _key = format["CHILD:999:SELECT `Start` FROM `charater_data`"];
    _data = _key call server_hiveReadWrite;

    I need that INT from "Start"  "1" to select don't know how
    and i need update it don't know how i tried with

    _key = format["CHILD:998:UPDATE `character_data` SET `Start`= 2"];
    _result = _key call server_hiveReadWrite; 

    Please someone help cant make this working.
    Thank you

    It is epoch 1.0.6

  5. 5 hours ago, juandayz said:

    @Andrej

    using a server side script you can try a quick adaptation of admin events to see if works.

    1-open your server_functions.sqf

      Hide contents
    
    
    find:
    
    server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";
    
    add below:
    
    //stbox
    server_stbox = compile preprocessFileLineNumbers "\z\addons\dayz_server\stbox\server_stbox.sqf";

     

    2-open your init.sqf

      Reveal hidden contents

    A_change the path for publicEH.sqf  by this

    
    
    call compile preprocessFileLineNumbers "custom\publicEH.sqf";

    b- at very bottom add:

    
    
    [] execVM "clientstbox\init_stbox.sqf"; 

     

    4-Drop your publicEH.sqf   ( Located in: \@DayZ_Epoch\addons\dayz_code\init\ ) 

    into mpmissions\your instance\custom\

    5. open the custom publicEH.sqf

      Reveal hidden contents
    
    
    find:
    "PVDZE_maintainArea" 	addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};
    
    below  paste:
    "PVDZE_stbox"      addPublicVariableEventHandler {(_this select 1) spawn server_stbox};

     

    6-Create sqfs

      Reveal hidden contents

    server_stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

      Reveal hidden contents
    
    
    
    private ["_date","_key","_result","_outcome","_datestr","_stbox"];
    diag_log("STARTERBOX INIT");
    _stbox = _this select 0;
    _key = "CHILD:307:";
    _result = _key call server_hiveReadWrite;
    _outcome = _result select 0;
    if(_outcome == "PASS") then {
        _date = _result select 1;
        _datestr  = str(_date);
        diag_log ("STARTER BOX EXECUTED: " + (_stbox) + " on " + _datestr);
        [] execVM "\z\addons\dayz_server\stbox\" + (_stbox) + ".sqf";
    };

     

    init_stbox.sqf (mpmissions\your instance\clientstbox\)

      Reveal hidden contents
    
    
    
    waituntil {!isnull (finddisplay 46)};
    sleep 15;
    executeevents = player addaction [("<t color=""#F7D708"">" + ("StarterBox") +"</t>"),"clientstbox\execute_stbox.sqf","",5,false,true,"",""]; 

     

    execute_stbox.sqf (mpmissions\your instance\clientstbox\)

      Reveal hidden contents
    
    
    
    stbox =
        [
            ["",true],
                ["Starter_Box", [2], "", -5, [["expression", '["stbox"] call STARTERBOX']], "1", "1"],
                ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]        
        ];
    
    showCommandingMenu "#USER:stbox";
    
    STARTERBOX =
    {    
        fn_doit = {
            PVDZE_stbox = [_this select 0];
            publicVariableServer "PVDZE_stbox";    
        };
        call fn_doit;
    };

     

    stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

      Reveal hidden contents
    
    
    private ["_crate"];
    
    if(isNil "script_in_progress")then{
            script_in_progress = false;
    };
     
    if(script_in_progress)exitwith{
            systemChat "This script is only useable once (untill restart)!";
    };
     
    
    
    box =
    	{
    	    script_in_progress = true;
    
    		_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                    _crate setpos  (player modelToWorld [0,6,0]);
                    _crate setDir ([_crate, player] call BIS_fnc_dirTo);
    
    	clearWeaponCargoGlobal _crate;
    	clearMagazineCargoGlobal _crate;
    
    	// add weapons
    		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
    		_crate addWeaponCargoGlobal ["ItemEtool", 2];
    		_crate addWeaponCargoGlobal ["ItemCompass", 2];
    		_crate addWeaponCargoGlobal ["Binocular", 2];
    		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
    		_crate addWeaponCargoGlobal ["ItemGPS", 2];
    		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
    		_crate addWeaponCargoGlobal ["ItemKnife", 2];
    		_crate addWeaponCargoGlobal ["ItemMap", 2];
    		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
    		_crate addWeaponCargoGlobal ["ItemWatch", 2];
    		_crate addWeaponCargoGlobal ["NVGoggles", 2];
    		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
    		_crate addWeaponCargoGlobal ["ItemMachete", 2];
    		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
    		_crate addWeaponCargoGlobal ["ItemShovel", 2];
    		_crate addWeaponCargoGlobal ["ItemSledge", 2];
    		_crate addWeaponCargoGlobal ["ChainSaw", 1];
    		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
    	
    	// add items
    	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
    		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
    		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
    		_crate addMagazineCargoGlobal ["MortarBucket", 26];
    		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
    		_crate addMagazineCargoGlobal ["ItemPole", 16];
    		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
    		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
    		_crate addMagazineCargoGlobal ["ItemVault", 2];
    		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
    		_crate addMagazineCargoGlobal ["ItemBandage", 10];
    		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
    		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
    		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
    		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
    	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
    	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
    	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
    	_crate addMagazineCargoGlobal ["PartEngine", 5];
    	_crate addMagazineCargoGlobal ["PartVRotor", 5];
    	_crate addMagazineCargoGlobal ["PartWheel", 24];
    	_crate addMagazineCargoGlobal ["PartGlass", 24];
    	_crate addMagazineCargoGlobal ["PartFueltank", 4];
    	_crate addMagazineCargoGlobal ["PartGeneric", 100];
    	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
    	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
    	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
    	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
    	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
    		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
    	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
    	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
    	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
    	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
    	
    	
    
    };
    call box;
    	
    
    
    sleep 90;
    deleteVehicle _crate;
    titleText ["crate was deleted","PLAIN DOWN"]; titleFadeOut 4;
    

     

     

    Man thank you a lot, much love <3

×
×
  • Create New...