Jump to content

sina alex

Member
  • Content Count

    26
  • Joined

  • Last visited

  • Medals

Posts posted by sina alex


  1. 2 hours ago, Harzach said:

    How and where are you executing your code?

     

     

    This tells us that the issue is locality.

    Many of the commands you are using are LE, meaning they must be executed on (or broadcast to) any machine where the effects need to be seen. 

     

    It seems as though you are executing on server, so you will need to either execute on clients or remoteExec instead.

    thank for answer,

    i use execvm in triger from game and on triger ,address the sqf file code as i send there.

     

    execvm "S\1.sqf";

     

    as you say the code must run on each client i can use this?

    [param] remoteExec ["doArtilleryFire", ([0, -2] select isDedicated), true];

    and how i can insert my code on param part ?!

    g1 doArtilleryFire [position han1,"8Rnd_82mm_Mo_shells",3];


  2. hello , i have run a test

    (about showing a target scene what there an ai must start fire 3 round of mortart to my target via mortar)

    on single player and multiplayer on my pc in both of ways it work successfully, camera start moving and show mortar and the ai start fire  fine,

    but when i up the mission to server for test the ai wont fire and just camera show he and he still not fire,

    i test this codes on server :

    _camera = "camera" camcreate position h2; 
    _camera cameraeffect ["internal", "back"]; 
    _camera camPrepareTarget g2;
    _camera camCommitPrepared 5; 
    g2 commandArtilleryFire [position han2, "8Rnd_82mm_Mo_shells",3];
    _camera camPreparePos position h2_1;
    _camera camPrepareFOV 0.700; 
    _camera camCommitPrepared 6;
    _camera camPrepareFOV 0.700; 
    waitUntil {camCommitted _camera};
    _camera cameraEffect ["terminate","back"]; 
    camDestroy _camera;

    for sure i test another command as :

    _camera = "camera" camcreate position h1; 
    _camera cameraeffect ["internal", "back"]; 
    _camera camPrepareTarget g1;
    _camera camCommitPrepared 5; 
    g1 doArtilleryFire [position han1,"8Rnd_82mm_Mo_shells",3];
    _camera camPreparePos position h1_1;
    _camera camPrepareFOV 0.700; 
    _camera camCommitPrepared 6;
    _camera camPrepareFOV 0.700; 
    waitUntil {camCommitted _camera};
    _camera cameraEffect ["terminate","back"]; 
    camDestroy _camera;

    both kind of codes work just in single and mp mod in my pc, and not work on server.

    any help have my regards.


  3. hello

    there i have a question about show video on billbord for players who are infront of it via add action, so we create a trigger and add below code on it:

    vp is name of the Addaction object 

    call{[vp, 
     "Pakhsh", 
     "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", 
     "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
     "_this distance _target < 2", 
     "_caller distance _target < 2", 
     {}, 
     {}, 
     {
    _video = "V\reza.ogv"; 
    _screen = namayeshgar;
    _screen setObjectTexture [0, _video]; 
    [_video] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), true];
    m1 setObjectTextureGlobal [0,"P\rs.jpg"];
    m2 setObjectTextureGlobal [0,"P\ma.jpg"];
    },  
     {hint "Laghve tanzim";}, 
     [], 
     5, 
     1000, 
     false, 
     false, 
     true 
     ] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true];};

    when i test this code i just find it the video is just visible by who call add action and not somebody else.

    how i can do it for all players infront of that billbord?


  4. 14 hours ago, Larrow said:

    The person using a UI is the player.

     

    
    _buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
    _buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
    _buttenExit ctrlAddEventHandler ["MouseButtonDown", {
    	params[ "_ctrl" ];
    	_display = displayParent _ctrl;
    	
    	_display closeDisplay 1;
    }];

     

     

    14 hours ago, Larrow said:

    The person using a UI is the player.

     

    
    _buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
    _buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
    _buttenExit ctrlAddEventHandler ["MouseButtonDown", {
    	params[ "_ctrl" ];
    	_display = displayParent _ctrl;
    	
    	_display closeDisplay 1;
    }];

     

    i want use it on a dedicated mp server.

    if i use player for apply loadouts it will not apply to every player in server??
    i want apply just on who use menu


  5. 11 hours ago, Larrow said:

    The person using a UI is the player.

     

    
    _buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
    _buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
    _buttenExit ctrlAddEventHandler ["MouseButtonDown", {
    	params[ "_ctrl" ];
    	_display = displayParent _ctrl;
    	
    	_display closeDisplay 1;
    }];

     

    I will test it,thank you


  6. hello 

     

    i use gui editor and create a tablet.

    and whats the plan: the tablet that have 3 picture(each picture are clickable) and when player click picture a loadout apply on him as this code:

    question 1 : how i can tell who active addeventhandler to group him,and apply loadout on his group?

    question 2 : wich code i need to close tablet as a exit button?

     

    [] spawn {
        waitUntil {sleep 0.0000001; !isNull (findDisplay 46)};
        methembyguimenu1 = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 210) then {
        [] spawn ArsenalDevice;
        };"];
     
    	ArsenalDevice = {
    	_display = findDisplay 46 createDisplay "RscDisplayEmpty";
    _guiphone = _display ctrlCreate ["RscPicture", 1200];
    _guiphone ctrlSetText "pb.paa";
    _guiphone ctrlSetPosition [0.2375, 0.004, 0.5, 1];
    _guiphone ctrlCommit 0;
    
    _buttenarmy = _display ctrlCreate ["RscActivePicture", 1201];
    _buttenarmy ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_armyloadout"];
    _buttenarmy ctrlSetText "army.paa";
    _buttenarmy ctrlSetPosition [0.38, 0.26, 0.2125, 0.08];
    _buttenarmy ctrlCommit 0;
    
    _buttensns = _display ctrlCreate ["RscActivePicture", 1202];
    _buttensns ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_snloadout"];
    _buttensns ctrlSetText "sns.paa";
    _buttensns ctrlSetPosition [0.38, 0.36, 0.2125, 0.08];
    _buttensns ctrlCommit 0;
    
    _buttennop = _display ctrlCreate ["RscActivePicture", 1203];
    _buttennop ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_noploadout"];
    _buttennop ctrlSetText "nop.paa";
    _buttennop ctrlSetPosition [0.38, 0.464, 0.2125, 0.08];
    _buttennop ctrlCommit 0;
    
    fnc_armyloadout = {
    _pg = _this select 0; 
    "laa" remoteExec ["playSound"]; 
    hint "loading";
    {
    removeAllWeapons _x; 
    removeAllItems _x; 
    removeAllAssignedItems _x; 
    removeUniform _x; 
    removeVest _x; 
    removeBackpack _x; 
    removeHeadgear _x; 
    removeGoggles _x; 
    _x addWeapon "CUP_arifle_G3A3_ris_black"; 
    _x addPrimaryWeaponItem "CUP_20Rnd_762x51_G3"; 
    _x addPrimaryWeaponItem "CUP_bipod_G3"; 
    _x addWeapon "CUP_launch_RPG7V"; 
    _x addSecondaryWeaponItem "CUP_optic_PGO7V3"; 
    _x addSecondaryWeaponItem "CUP_PG7V_M"; 
    _x addWeapon "rhsusf_weap_m9"; 
    _x addHandgunItem "rhsusf_mag_15Rnd_9x19_JHP"; 
    _x forceAddUniform "rpat_urban_1_uniform"; 
    _x addVest "ARMY_V_PlateCarrier_ACU_L"; 
    _x addBackpack "B_Carryall_oucamo"; 
    _x addWeapon "rhsusf_bino_m24_ARD"; 
    for "_i" from 1 to 5 do {_x addItemToUniform "ACE_packingBandage";}; 
    for "_i" from 1 to 4 do {_x addItemToUniform "ACE_morphine";}; 
    for "_i" from 1 to 4 do {_x addItemToUniform "ACE_tourniquet";}; 
    for "_i" from 1 to 15 do {_x addItemToUniform "ACE_fieldDressing";}; 
    for "_i" from 1 to 5 do {_x addItemToVest "CUP_20Rnd_TE1_Yellow_Tracer_762x51_G3";}; 
    for "_i" from 1 to 2 do {_x addItemToVest "SmokeShell";}; 
    for "_i" from 1 to 2 do {_x addItemToVest "rhsusf_mag_15Rnd_9x19_JHP";}; 
    for "_i" from 1 to 2 do {_x addItemToVest "rhs_mag_m67";}; 
    for "_i" from 1 to 49 do {_x addItemToBackpack "ACE_fieldDressing";}; 
    for "_i" from 1 to 30 do {_x addItemToBackpack "ACE_morphine";}; 
    for "_i" from 1 to 4 do {_x addItemToBackpack "ACE_tourniquet";}; 
    _x addItemToBackpack "ACE_Flashlight_XL50"; 
    _x addItemToBackpack "ACE_IR_Strobe_Item"; 
    _x addItemToBackpack "ACE_EntrenchingTool"; 
    for "_i" from 1 to 3 do {_x addItemToBackpack "ACE_epinephrine";}; 
    _x addItemToBackpack "ACE_EarPlugs"; 
    _x addItemToBackpack "ACE_SpraypaintBlue"; 
    _x addItemToBackpack "ACE_SpraypaintBlack"; 
    _x addHeadgear "marpat_urban_helmet"; 
    _x linkItem "ItemMap"; 
    _x linkItem "ItemCompass"; 
    _x linkItem "tf_microdagr"; 
    _x linkItem "tf_anprc152"; 
    _x linkItem "ItemGPS"; 
    _x linkItem "rhsusf_ANPVS_15";  
    } foreach _pg;
    };
    
    	};
     
    };

     


  7. hey everyone

     

    i have a problem in this code:

    main tip : player stay near sign and in holdaction spawn a code that will apply new loadout on him

    but problem is there i see this loadout applyed on others too.

    server is dedicate

    code work but applyed on all not that player who call it.

    of course i use a group the caller to prevent from apply to all with this code 

    _pg = group _caller; 

    and code will apply to 

    forEach units _pg; 

     

    help me up to prevent to apply to others

     

     

    [s4, 
     "LoadOUT", 
     "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", 
     "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
     "_this distance _target < 2", 
     "_caller distance _target < 2", 
     {"laa" remoteExec ["playSound"];}, 
     {hint "iw";}, 
     {_pg = group _caller; 
    { 
    removeAllWeapons _x; 
    removeAllItems _x; 
    removeAllAssignedItems _x; 
    removeUniform _x; 
    removeVest _x; 
    removeBackpack _x; 
    removeHeadgear _x; 
    removeGoggles _x; 
    _x addWeapon "hlc_smg_MP5N"; 
    _x addPrimaryWeaponItem "hlc_30Rnd_9x19_B_MP5"; 
    _x addWeapon "rhsusf_weap_m9"; 
    _x addHandgunItem "rhsusf_mag_15Rnd_9x19_FMJ"; 
    _x forceAddUniform "B_BLK_BLK_soldier_F_uniform"; 
    _x addVest "IRI_V_Sheriff_BA_TB"; 
    _x addWeapon "Binocular"; 
    _x addItemToUniform "FirstAidKit"; 
    for "_i" from 1 to 2 do {_x addItemToUniform "hlc_30Rnd_9x19_B_MP5";}; 
    _x addItemToUniform "SmokeShell"; 
    _x addItemToUniform "MiniGrenade"; 
    for "_i" from 1 to 3 do {_x addItemToVest "hlc_30Rnd_9x19_B_MP5";}; 
    _x addItemToVest "rhsusf_mag_15Rnd_9x19_FMJ"; 
    for "_i" from 1 to 5 do {_x addItemToVest "rhs_mag_mk84";}; 
    for "_i" from 1 to 2 do {_x addItemToVest "MiniGrenade";}; 
    _x addItemToVest "SmokeShell"; 
    _x addHeadgear "H_PASGT_basic_black_F"; 
    _x addGoggles "G_Balaclava_TI_G_blk_F"; 
    _x linkItem "ItemMap"; 
    _x linkItem "ItemGPS";
    _x linkItem "ItemCompass"; 
    _x linkItem "ItemWatch"; 
    _x linkItem "ItemRadio"; 
    _x linkItem "NVGoggles_OPFOR"; 
    [_x,"Pad_A3_01","male01per"] call BIS_fnc_setIdentity; 
    [_x,"rw_Service_qe"] call BIS_fnc_setUnitInsignia; 
    } forEach units _pg; 
    hint "NO"; 
    }, 
     {hint "Lm";}, 
     [], 
     2, 
     1000, 
     false, 
     false, 
     true 
     ] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true];

     


  8. 4 hours ago, Larrow said:

    A dead unit is side civilian. Instead check the side of its group.

    There are also other problems as commented below.

      Hide contents
    
    
    player addEventHandler[ "Killed", {
    	params[ "_unit", "_killer", "_instigator", "_useEffects" ];
    	
    	//If we do not have an instigator
    	if ( isNull _instigator ) then {
    		//was the killer a controlled UAV
    		_instigator = ( UAVControl vehicle _killer ) select 0;
    		//If we still do not have an instigator
    		if ( isNull _instigator ) then {
    			//use the killer
    			_instigator = _killer;
    		};
    	};
    	
    	if ( side group _unit == independent ) then {
    		systemChat format[ "%1 killed by %2", name _unit, name _instigator ];
    		_f1 = createVehicle[ "FlagCarrierChecked", getPos _unit, [], 0, "NONE" ];
    		
    		//This command no longer exists in Arma 3
    		//setVehicleInit
    		
    		_f1 setObjectTextureGlobal[ 0, "p\1.jpg" ];
    		hint format[ "You were killed by %1", name _instigator ];
    		
    		//This event script is called automatically on player death
    		//nul = [] execVM "onPlayerKilled.sqf";
    	};
    }];

     

     

    thank for answer.

    i know it about formating a dialog or chat.

    and about killing board.

    now what i can do for add init to spawned objects via script??


  9. hello everybody

    i have a plan about marking th position where , the player killed.

     

    so in init.sqf in

    addEventHandler killed

    i add a sign(empty small wooden ),

    i try add command  for give it init to set globaltexture command but not work.

    the sign just got spawn with no screen on it,(my init cmd not activated).

     

    its code :

    Player addEventHandler ["Killed", {
    	params ["_unit", "_killer", "_instigator", "_useEffects"];
            if (side _unit == independent) 
    	then 
    	{
    	systemchat "_unit killed by _killer";
    	_f1 = createvehicle ["FlagCarrierChecked", getPos _unit, [], 0, "NONE"];
    	_f1 setVehicleInit "this obj setObjectTextureGlobal [0,'p\1.jpg']";
    	hint "You killed by _killer";nul = [] execVM "onPlayerKilled.sqf";
    	};
    }];

    help me to spawn that sign with my custom pic on dead pos.ty


  10. 12 hours ago, 7erra said:
    
    _this call {
    	params ["_bim", "_player", "_fa"];
    };

    _this is (usually) an array, see https://community.bistudio.com/wiki/Category:Data_Types and https://community.bistudio.com/wiki/Magic_Variables#this .

    The params command is essentially only assigning variables to the elements of that array:

    
    private _element1 = _this select 0;
    // SAME AS:
    params ["_element1"];

    Also, all opening brackets ( "(, [, {" ) must be closed again.

    Pay attention to the syntax of the commands you use: https://community.bistudio.com/wiki/SQF_syntax.

    Hello

    First thank you for help me to find new informations.

    Then i know arrays and params better, i read wiki pages you tell there about params and data types and arrays and varriables i read subjects:

    append,+,*,-,set varriable,get varriable

     

    But for my code i think deep,the only way was near in my mind is create var about _player and _object and _add id

    And save it on them then get it in next run

    Its like an view in my mind.

    What i can do on it?


  11. 20 hours ago, 7erra said:

    There is so much wrong with this script. Please read the BIKI more carefully.

    you are right , im new in scripting so i dont see most of wiki pages like params or i wasnt know it commands use

    and with near help of opusfmspol i look and follow page of params and first think i find in last page is it by you,i think its my problem fix

     

    [1, 2, [3, 4]] call {
        params ["_one", "_two", "_this"];
        params ["_three", "_four"];
    };

    but a few question to inserting :

    
    [ _this select 0,  _this select  1, _this select   call {
    
                 params ["_bim", "_player", "_fa"];
    
    };

    do its correct or not?

    or what i must do about it?!

     

    plz show me my coding problems , it help me to improve my codings.

    ty for you answer+helps.


  12. hello

    its a mp code runned by addaction on medical tent whe player distance are less 12m

    Chador addAction ["test", "S\test.sqf",nil,1.5,true,true,"","",12,false]

    in test on sp mode

    error say about the sqf file

    _Player = #_this select 1;

    i think its about last line i call sqf more time

    but how fix it?

    test.sqf

    _player = _this select 1;
    _Bim = _this select 0;
    _f = _this select 2;
    
    params ["_Bim","_Player","_Playerg","_Damage","_majruhin","_Newhealth","_playerpos"];
    
    _playerpos = getPos _Player;
    _Damage = (damage _Player);
    _majruhin = [];
    _Playerg = group Player;
    _Newhealth = _Damage - 1;
    
    if ( _Damage > 1 ) exitWith {hint format ["%1 salamatiye shoma kamel ast", name _Player];};
    if ( (_Damage < 100) && _Player distance _Bim < 10) then 
    {
    _med1 = "C_Man_Paramedic_01_F" createvehicle [605.027,5290.74,0];
    _med2 = "C_Man_Paramedic_01_F" createvehicle [605.027,5290.74,0];
    _medteam = creategroup civilian;
    _medteam = [];
    [_med1,_med2] pushBack _medteam;
    _gp = [_majruhin,_medteam];
    { [_x] disableAI "MOVE"; [_x] allowdamage false;} forEach (_medteam);
    sleep 5;
    HINT "CRETED AND PB";
    SLEEP 1;
    [_Player] pushBack _majruhin;
    { _x enableAI "MOVE"; _x doMove (_playerpos);}forEach (_medteam);
    { _x disableAI "MOVE"; _X playAction "Medic";}forEach (_majruhin);
    sleep 1;
    
    _Player setDamage _Newhealth;
    hintSilent format [" %1 mizane salamatiye shoma %2 afzayesh yaft ", name _Player, _Newhealth];
    sleep 2;
    { _x enableAI "MOVE"; _X playAction "Medic";}forEach (_majruhin);
    if ( _Damage > 99 ) then {hintSilent format [ "%1 salamatiye shoma kamel shod", name _Player];};
    [_Player] pushBack _Playerg;
    {_x doMove (getPos _bim);}forEach (_medteam);
    };
    waitUntil {_medteam distance _Bim < 2};
    deleteVehicle _med1;
    deleteVehicle _med2;
    waitUntil {alive _Player};
    execVM "S\test.sqf";

     

×