Jump to content

cen

Member
  • Posts

    1706
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by cen

  1. Got it!

     

    Code:

    /*** Created by 0verHeaT ***/


    private ["_Missing","_index","_SpawnPats","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
    _index = _this select 0;
    if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

    _veh = VehStoredList select _index;
    _vehicle = _veh select 0;
    _key = _veh select 1;
    _Missing = "";
    _vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

    if (_vehicle select 0 isKindOf 'Air') then {
    _SpawnPats = ["Sr_border"];
    _Missing = "Helipad";
    } else {
    _SpawnPats = ["PARACHUTE_TARGET"];
    _Missing = "Parking Lot";
    };

    _helipadsnear = nearestObjects [(getPosATL player),_SpawnPats,50];
    if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a "+_Missing+"! Right click on your Toolbox to build one!","PLAIN DOWN"]};

    _nearestpad = _helipadsnear select 0;
    _position = getPosATL _nearestpad;

    _checkkey = [player,_key] call BIS_fnc_invAdd;
    if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

    _sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
    _sign setPos _position;

    PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
    publicVariableServer "PVDZE_veh_spawn";

    cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

    sleep 2;
    call garage_getnearVeh;
    call garage_getstoredVeh;

     

    EDIT: I lied.

     

    First one (very top) spawned fine, and the other two... well... as you can see:

     

    RSKd6JP.jpg

  2. Doesn't work for me. Vehicle doesn't get DB coords.

    AXdDXPr.png

     

    Code I'm using:

     

    /*** Created by 0verHeaT ***/


    private ["_Missing","_index","_SpawnPats","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
    _index = _this select 0;
    if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

    _veh = VehStoredList select _index;
    _vehicle = _veh select 0;
    _key = _veh select 1;
    _Missing = "";
    _vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

    if (_vehicle select 0 isKindOf 'Air') then {
    _SpawnPats = ["Sr_border"];
    _Missing = "Helipad";
    } else {
    _SpawnPats = ["PARACHUTE_TARGET"];
    _Missing = "Parking Lot";
    };

    _helipadsnear = nearestObjects [(getPosATL player),_SpawnPats,50];
    if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a "+_Missing+"! Right click on your Toolbox to build one!","PLAIN DOWN"]};

    _nearestpad = _helipadsnear select 0;
    _position = getPosATL _nearestpad;
    _position = [_location select 0, _location select 1, _location select 2 + 0.2];

    _checkkey = [player,_key] call BIS_fnc_invAdd;
    if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

    _sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
    _sign setPos _position;

    PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
    publicVariableServer "PVDZE_veh_spawn";

    cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

    sleep 2;
    call garage_getnearVeh;
    call garage_getstoredVeh;

  3.  

    Hi,

     

    so if you placed a heli pad under or above the metal floor (which is the same as under the metal floor, because it'll allways be painted on ground), then it's pretty Normal, that the Heli can't spawn there, as there is no space. it will find the best suitable position, which in that case is 30m above that metal floor.

    If you add the Metal Floor to this:

    _helipads = ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross"];
    
    <SNIP>

     

    Tried this UK and it didn't even spawn the vehicle :D

  4. I can use another object as a spawn "marker" for the vehicle, but I can't find what is choosing the position of the vehicle in the code.

     

    Here's the spawn vehicle code:

    /*** Created by 0verHeaT ***/


    private ["_index","_helipads","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
    _index = _this select 0;
    if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

    _veh = VehStoredList select _index;
    _vehicle = _veh select 0;
    _key = _veh select 1;

    _vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

    _helipads = ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross"];

    _helipadsnear = nearestObjects [(getPosATL player),_helipads,50];
    if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a Helipad! Right click on your Toolbox to build one!","PLAIN DOWN"]};

    _nearestpad = _helipadsnear select 0;
    _position = getPosATL _nearestpad;

    _checkkey = [player,_key] call BIS_fnc_invAdd;
    if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

    _sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];

    PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
    publicVariableServer "PVDZE_veh_spawn";

    cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

    sleep 2;
    call garage_getnearVeh;
    call garage_getstoredVeh;

  5. /* Set Damage on all other objects */
    UPDATE `object_data`
    SET `Damage`=0.2
    WHERE `ObjectUID` <> 0
    AND `CharacterID` <> 0
    AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
    AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') );
    
    /* Set Damage On Doors/Plot Poles using Door Management via Age */
    UPDATE `object_data`
    SET `Damage`=0.2
    WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
    AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY)
    AND `Inventory` != '[]';
    
  6. Hero humanity is on top, bandit on bottom, so should work since the top is done by epoch devs :D

    		if (!_punishment) then {
    			//i'm "not guilty" - kill me && be punished
    			_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
    			_humanityHit = -(2000 - _myKills);
    			_kills = _source getVariable ["humanKills",0];
    			_source setVariable ["humanKills",(_kills + 1),true];
    			PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
    			publicVariableServer "PVDZE_send";
    		} else {
    			//i'm "guilty" - kill me as bandit
    			//_killsV = _source getVariable ["banditKills",0];
    			//_source setVariable ["banditKills",(_killsV + 1),true];
    			_myKillsB = ((player getVariable ["banditKills",0]) / 30) * 1000;
    			_humanityHit = (2000 + _myKillsB);
    			_killsV = _source getVariable ["banditKills",0];
    			_source setVariable ["banditKills",(_killsV + 1),true];
    			PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
    			publicVariableServer "PVDZE_send";
    		};
    
  7. Find Vehicle Function - FindVehicleKeysCount:

    BEGIN





    DECLARE totalKeys INT DEFAULT 0;



    DECLARE keyName VARCHAR(32) DEFAULT "";



    DECLARE keysInChar INT DEFAULT 0;



    DECLARE keysInObj INT DEFAULT 0;



    SET keyName = (CASE



    WHEN `keyId` < 2501 THEN CONCAT('ItemKeyGreen', `keyId`)



    WHEN `keyId` < 5001 THEN CONCAT('ItemKeyRed', `keyId` - 2500)



    WHEN `keyId` < 7501 THEN CONCAT('ItemKeyBlue', `keyId` - 5000)



    WHEN `keyId` < 10001 THEN CONCAT('ItemKeyYellow', `keyId` - 7500)



    WHEN `keyId` < 12501 THEN CONCAT('ItemKeyBlack', `keyId` - 10000)



    ELSE 'ERROR'



    END);



    SET keysInChar = (SELECT COUNT(*) FROM `Character_DATA` WHERE `Alive` = '1' AND (`Inventory` LIKE CONCAT('%', keyName, '%') OR `Backpack` LIKE CONCAT('%', keyName, '%')));



    SET keysInObj = (SELECT COUNT(*) FROM `Object_DATA` WHERE `Inventory` LIKE CONCAT('%', keyName, '%'));



    RETURN (keysInChar + keysInObj);



    END

     

    Delete Function - DeleteNonKeyVehicles (I changed it to unlock instead of delete:

    BEGIN





    UPDATE `object_data`



    SET `CharacterID` = 0



    WHERE



    `object_data`.`CharacterID` <> 0



    AND `Object_DATA`.`CharacterID` <= 12500



    AND `Object_DATA`.`Classname` NOT LIKE 'Tent%'



    AND `Object_DATA`.`Classname` NOT LIKE '%Locked'



    AND `Object_DATA`.`Classname` NOT LIKE 'Land%'



    AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%'



    AND `Object_DATA`.`Classname` NOT LIKE 'Wood%'



    AND `Object_DATA`.`Classname` NOT LIKE 'Metal%'



    AND `Object_DATA`.`Classname` NOT LIKE '%Storage%'



    AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ')



    AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0;



    RETURN ROW_COUNT();



    END

     

    SQL Query to run:

    SELECT DeleteNonKeyVehicles();
    
×
×
  • Create New...