Jump to content

Norbak

Member
  • Content Count

    141
  • Joined

  • Last visited

  • Medals

Posts posted by Norbak


  1. Anyone know how to save some variable for a specific player before logging out from a multiplayer mission and load the same when connecting again?. The same variables assigned for a specific player. It could be something like this?:

     

     

    • Variable1 = player setVariable ["Car",1,false];
    • Variable1 setVariable ["ownerUid", getPlayerUID player, True];    PublicVariableServer "Variable1";

     

    It'd be nice if the variable1 is different for a player than other. So Variable1 [Car]  is "1" for player1 ,but it's "0" for player2, and so.

     

    Any idea to load those stats like an inventory in DayZ but in Arma 2 using variables?. Thanks!


  2. OK i know now. The PublicVariable calls for the EH only for Clients, not for caller. The caller just begin the process and starts the effect written in the original .sqf using this part to show:

    This part:
    -------------------------------
    _lplayer lightAttachObject [_target,[0,0,1.2]];
    _lplayer setLightBrightness 0.06;
    _lplayer setLightAmbient [0.2,0.4,0.2];
    _lplayer setLightColor [2,2,2];
    -------------------------------
    

    So the Caller needs this part to get the effects shown on his computer. Am i right?


  3. The person who starts the script should also have the EH in the event of somebody else also starting the script.

    I think it's not my question. Putting that EH Variable in the init.sqf makes everybody to have the call for that EH. It's ok.

     

     

    But is this part needed to get the script to work successfully, the caller and the client light effect?:

    _target = cursorTarget;
    _tposition = getPos _target;
    _lplayer = "#lightpoint" createVehicle _tposition;
    
    
    This part:
    -------------------------------
    _lplayer lightAttachObject [_target,[0,0,1.2]];
    _lplayer setLightBrightness 0.06;
    _lplayer setLightAmbient [0.2,0.4,0.2];
    _lplayer setLightColor [2,2,2];
    -------------------------------
    
    
    
    
    lightEffects = [_lplayer, 0.06, [0.2,0.4,0.2], [2,2,2]]; // <--- The order of lightEffects must be [light, brightness, ambient, color]
    publicVariable "lightEffects";
    
    sleep 12;
    deleteVehicle _lplayer;
    

    because the Caller also has the EH Variable in his init.sqf and it's called from:

    
    lightEffects = [_lplayer, 0.06, [0.2,0.4,0.2], [2,2,2]]; // <--- The order of lightEffects must be [light, brightness, ambient, color]
    publicVariable "lightEffects";
    

    so is still needed or will he get both effects working at the same time: "caller script light" and "EH light"??. I don't understand that. It's a bit difficult.


  4. Evry client must run the EH in the init.sqf. I know but Does the script starter need to do aswell?.

    Does he need this part... 

    _lplayer lightAttachObject [_target,[0,0,1.2]];
    _lplayer setLightBrightness 0.06;
    _lplayer setLightAmbient [0.2,0.4,0.2];
    _lplayer setLightColor [2,2,2];
    

    ... if he is running the EH aswell?. Maybe i didn't see the light effect because i skipped that part of the script.

    if he is running


  5. I'm trying to make my own CTF mode where i want to find the nearest unit within 5 meters of the flag where that unit is _unit. i have been searching around in different forums but cannot find anything that i can use that works. I am quite new to scripting and trying to learn as much as i can.

     

    This is what i have so far:

    //the init of the flag
    [[blueflag,["Pickup","blueflag.sqf"]],"addAction",true] call BIS_fnc_MP;

    You're confused. This is for Arma 3 not for Arma 2 / OA


  6. Control + Space keys for High Commander Options. And hit [.] for Cammand View.

     

     

    And inside a script...? :

    WaitUntil{!isNull player}; waituntil {alive player};
    sleep 0.2;
    
    _player = _this select 0; // player Or Name.
    
    createcenter sidelogic;
    _group = creategroup sidelogic;
    
    Commander = _group createunit ["HighCommand",position _player,[],0,"none"];
    Sub = _group createunit ["HighCommandSubordinate",position _player,[],0,"none"];
    Sub synchronizeObjectsAdd [Commander];
    Commander synchronizeObjectsAdd [_player];
    
    HCShowBar true; // Show High Commander Action Bar since the begining.
    
    

  7. What are you trying to achieve? The code you have shown there will do nothing, unless you have more that you have not shown.

    Something like this. Still working:

    _target = CursorTarget;
    _TPosition = getPos _target;
    _lplayer = "#lightpoint" createVehicle _TPosition;
    
    _lplayer lightAttachObject [_target,[0,0,1.2]];
    _lplayer setLightBrightness 0.06;
    _lplayer setLightAmbient [0.2,0.4,0.2];
    _lplayer setLightColor [2,2,2];
    
    sleep 12;
    deleteVehicle _lplayer;
    
    
    
    

    So making this global should be great, Everybody could see the effect on the CursorTarget. Any ideas?


  8. Great!. And is that for deleting differents items at the same time when disconnected?. So, it's great!

     

     

    Then i use this type of script to delete markers and triggers aswell?

     

    -marker-

    Mymarker1 = createmarker ["marker1",getpos player1];

         Mymarker1 setmarkerText format ["Myposition",name player];
         Mymarker1 setmarkerType "city";
         Mymarker1 setMarkerColor "ColorRed";
         Mymarker1 setmarkerpos getPos player1;

     

         YourOwnVehicle = Mymarker1;

         Yourownvehicle setVariable ["ownerUid", getPlayerUID player, true];

         publicVariableServer "YourOwnVehicle";

     

     

    -trigger-

    Mytrigger = createTrigger ["EmptyDetector", [0,0,0]];
    Mytrigger setTriggerArea [0, 0, 0, false];
    Mytrigger setTriggerActivation ["NONE", "present",true];

     

    YourOwnVehicle = Mytrigger;

    YourOwnVehicle setVariable ["ownerUid", getPlayerUID player, true];

    publicVariableServer "YourOwnVehicle";

     

     

    Then those will delete Yourownvehicle at the same time if needed, when Yourownvehicle is: Yourownvehicle,Anotheritem,Aflyingcarpet,Mymarker1,Mytrigger?


  9. I meant a different item.

    • "YourOwnVehicle" addPublicVariableEventHandler {
    •     YourOwnVehicles set [count YourOwnVehicles, YourOwnVehicle];
    •  
    •     YourOwnVehicle = nil;
    • };
    • "Anotheritem" addPublicVariableEventHandler {
    •     YourOwnVehicles set [count YourOwnVehicles, anotheritem];
    •  
    •     anotheritem = nil;
    • };
    • "Aflyingcarpet" addPublicVariableEventHandler {
    •     YourOwnVehicles set [count YourOwnVehicles, Aflyingcarpet];
    •  
    •     Aflyingcarpet = nil;
    • };

    And so. Because those items are made yet with static names.


  10. I  see. Using UID is a good idea. I wasn't to know how to do this. So i'll test and i'll reply you,Schaten.

    But if we need to delete more than one item while disconnected?. maybe? ====>

     

    • "YourOwnVehicle2" addPublicVariableEventHandler {
    •     YourOwnVehicles set [count YourOwnVehicles, YourOwnVehicle2];
    •  
    •     YourOwnVehicle2 = nil;
    • };
      • "YourOwnVehicle3" addPublicVariableEventHandler {
      •     YourOwnVehicles set [count YourOwnVehicles, YourOwnVehicle3];
      •  
      •     YourOwnVehicle3 = nil;
      • };
×