Jump to content

Norbak

Member
  • Content Count

    141
  • Joined

  • Last visited

  • Medals

Posts posted by Norbak


  1. I'm doing something wrong.it's not working now for me.do i need to place Onplayerdisconnected in init.sqf or in a trigger in the editor?

    Server side is a trigger in the editor ,yes?. Repeatable and local player?

     

    And another issue:

     

    YourOwnVehicles = [];

    onPlayerDisconnected "
        {_x spawn {deleteVehicle _this}} forEach YourOwnVehicles;

        YourOwnVehicles = [];
    "
    ;

    "YourOwnVehicle" addPublicVariableEventHandler {
        YourOwnVehicles set [count YourOwnVehicles, YourOwnVehicle];

        YourOwnVehicle = nil;
    };

     

    Every player ( player1 and player2) are able to spawn a "Yourownvehicle". When one of them disconnects the other Yourownvehicle item is deleted aswell, not only the player1's vehicle. Is this correct?. Is there any kind of fix this to delete only our own item?


  2.  

    When a player gets in the area and use the itemx the trigger detects the creation of this itemx and the Actions begin.

     

    That's cool for singleplayer but i saw an AI or another player could get in the area aswell and activate the trigger.Then you couldn't use the ITEMX even from outside the area. Switching Activation: BLUFOR to NONE ,nothing happened. Any idea?

     

     

    ((itemx distance thisTrigger) < ((triggerArea thisTrigger) select 0)) and {(itemx distance thisTrigger) < ((triggerArea thisTrigger) select 1)}

    It didn't work, Schatten.

     

    :(


  3. Ok, Schatten.

    A quick question about distance again using triggers. If i put a trigger with Axis a and b. Which should the CONDITION be to detect a contruction of an ITEMX or a VEHICLEX inside the range of the trigger when that ITEMX is created?

     

    Condition: itemx distance thistrigger < distance? (doesn't work)

                     Itemx distance thistrigger < (don't want a number, i need the range of the trigger, or manually [x,y])


  4. But that "_this" in "ArraysToDelete = _this nearObjects [["Thing","Car","Static"], 20];" shouldn't be the player but something inside BASE..

     

    Maybe using this in Client Side 2? :

     

    CLIENT SIDE 2:

    itemx = createVehicle ["Baseball", [(getpos player) select 0,(getpos player) select 1,0], [], 0, "NONE"];    // Spawning that base creates ITEMX aswell.

    And changing Server Side to:

     

    ArraysToDelete = itemx nearObjects [["Thing","Car","Static"], 20];


  5. I'm learning to use these commands. Thank you.

     

    Next level. More than one array inside ONDISCONNECTED?

     

     

     

    Server Side:

     

    YourOwnVehicles = [];

    ArraysToDelete = _this nearObjects [["Thing","Car","Static"], 20];

     

    onPlayerDisconnected "
        {_x spawn {deleteVehicle _this}} forEach YourOwnVehicles;

        {_x spawn {deleteVehicle _this}} forEach ArraysToDelete;

        YourOwnVehicle = [];
        ArraysToDelete = [];
    ";
     

    "YourOwnVehicle" addPublicVariableEventHandler {

        YourOwnVehicles set [count YourOwnVehicles, YourOwnVehicle];

        YourOwnVehicle = nil;
    };

     

     

    "BASE" addPublicVariableEventHandler {

       ArraysToDelete set [count ArraysToDelete, BASE];

       BASE = nil;
    };

     

     

    CLIENT SIDE 1:

     

    YourOwnVehicle = "Old_moto_TK_Civ_EP1" createVehicle [(getPos player select 0), (getPos player select 1), 0.3];

    publicVariableServer "YourOwnVehicle";

     

    CLIENT SIDE 2:

     

    BASE = [getPos Player, random 360, "smallbase_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

    publicVariableServer "BASE";


  6. I tried something like this:

     

     

    _Target = nearestObject position player;

     

    if (_Target isKindof "Man" && _Target distance player <= 20) then     {

     

                                                            Hint "somebody is near";
                                                                                                                              };
     

     

    And i think it works but i need to make a distance between >90 and <10. Or something like that because the condition is detecting player as himself like an "Man"  . Any idea please?.

    Thanks in advance.

×