Jump to content

snaivi

Member
  • Posts

    6
  • Joined

  • Last visited

Posts posted by snaivi

  1. Love the script, great work! It has added some really neat bases on my server. My only concern/problem with this script as been that some...."inventive" players have noticed that the build portion of the script doesn't look for a plot pole before allowing them to upgrade a metal floor (or roof in this case) to an elevator, then upgrade an adjoining metal floor (roof) to an elevator stop....since the elevator stop is the transparent version of the metal floor, it is passable and it allows them access into otherwise secure bases...I changed the elevator_build.sqf with some code from player_build.sqf in the epoch code to look for plot poles before allowing a player to build an elevator. I figured I would share it here...so far it works as intended on my server....it allows plot owners and friendlies to build elevators where plot poles exist, and denies it to those who aren't normally allowed to build on someone's plot.

     

    Here's what I changed it to:

     

    elevator_build.sqf:

     

    after this:

    player removeAction s_player_elevator_upgrade;
    s_player_elevator_upgrade = 1;
    player removeAction s_player_elevator_upgrade_stop;
    s_player_elevator_upgrade_stop = 1;
     
    I added:
    // check for near plot
    _canBuildOnPlot = false;
    _distance = DZE_PlotPole select 0;
    _needText = localize "str_epoch_player_246";
    _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
    _findNearestPole = [];
    
    
    {
    if (alive _x) then {
    _findNearestPole set [(count _findNearestPole),_x];
    };
    } foreach _findNearestPoles;
    
    
    _IsNearPlot = count (_findNearestPole);
    
    
    if(_IsNearPlot == 0) then {
    _canBuildOnPlot = true;
    } else {
    // Since there are plots nearby we check for ownership and then for friend status 
    // check nearby plots ownership and then for friend status
    _nearestPole = _findNearestPole select 0;
    // Find owner 
    _ownerID = _nearestPole getVariable["CharacterID","0"];
    // diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
    // check if friendly to owner
    if(dayz_characterID == _ownerID) then {  //Keep ownership
    // owner can build anything within his plot except other plots
    _canBuildOnPlot = true; 
    } else {
    _friendlies = player getVariable ["friendlyTo",[]];
    // check if friendly to owner
    if(_ownerID in _friendlies) then {
    _canBuildOnPlot = true;
    };
    };
    };
    if(!_canBuildOnPlot) exitWith {  DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; };
    
    

     

    There might be a better way to do it, but this fixed it for me for now. 

     

    Sorry about the formatting, It was being a pain, so meh.

     

    Axe, i try that fix for glitchers who, swap , metal floor in metal floor preview to join in our base. I think we can use the same for limit, activate elevator to next stop and activate for prev stop. This code just, limit upgrade if you arnt plot pole owner, It can be done for my qestion right?.

  2. Hello, i have install correctly WAI Mision system in my server, but it was designed with Vehicles wich are saved in db, and i need to change this,

     

    i see that system use custom publishVehicle.sqf and mission vehicles have setVariable [ObjectID,1,true] and another commands that not appear in EMS per example.

     

    Please someon can tell me how i can set that missions, for vehicles dont save in Data base?

     

    thx and sorry for my bad english.

  3. Anyone knows, how to do, mission's vehicles dessapear after restart?, i try deleting that lines

     

    _veh setVariable ["ObjectID","1",true];
    PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];

     

    and putting

     

    _veh setVariable["MalSar",1,",true]

     

    that variable is used by admin tools for tempvehicles dont blow up, in Antihack exceptions

     

    any clue? for this?

×
×
  • Create New...