Sign in to follow this  
derfeldarzt

Making own Marker Type !

3 posts in this topic

Hey Guys im just digging for

Days in the Exile_Client_Code to create a own Marker Type .

The Idea is to setup multiple PVP Areas on a PVE Server with 3rd Person View restriction and maybe adding 10 Respect Points every 5 Min . to get People in there .

What im try to do is making a own Marker Type so i dont have to use Trigger Points and i could just set a Map Marker with a Type = "ExilePVPZone";

But i just dont get it where i can excatly get the Variable on true ExilePlayerinPVPZone .

I used the Safezone Codes to change them but like i said i couldnt find the right way to make it work .

The ExileClient_system_map_initialize.sqf

Spoiler

/**
 * ExileClient_system_map_initialize
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

ExileSpawnZoneMarkerPositions = [];
ExileSpawnZoneMarkerPositionsAndSize = [];
ExileTraderZoneMarkerPositions = [];
ExileTraderZoneMarkerPositionsAndSize = [];
ExileNonConstructionZones = [];
ExileConcreteMixerZones = [];
ExileContaminatedZones = [];
ExilePVPZoneMarkerPositions = [];
ExilePVPZoneMarkerPositionsAndSize = [];
{
    switch (getMarkerType _x) do
    {
        case "ExileSpawnZone":
        {
            ExileSpawnZoneMarkerPositions pushBack (getMarkerPos _x);
            ExileSpawnZoneMarkerPositionsAndSize pushBack
            [
                getMarkerPos _x,
                (getMarkerSize _x) select 0
            ];
        };
        case "ExileNonConstructionZone":
        {
            ExileNonConstructionZones pushBack
            [
                getMarkerPos _x,
                (getMarkerSize _x) select 0
            ];
        };
        case "ExileTraderZone":
        {
            ExileTraderZoneMarkerPositions pushBack (getMarkerPos _x);
            ExileTraderZoneMarkerPositionsAndSize pushBack
            [
                getMarkerPos _x,
                (getMarkerSize _x) select 0
            ];
        };
        case "ExileContaminatedZone":
        {
            ExileContaminatedZones pushBack
            [
                getMarkerPos _x,
                ((getMarkerSize _x) select 0) * 0.75,
                ((getMarkerSize _x) select 0)
            ];
        };
        case "ExileConcreteMixerZone":
        {
            ExileConcreteMixerZones pushBack
            [
                getMarkerPos _x,
                (getMarkerSize _x) select 0
            ];
        };
        case "ExilePVPZone":
        {
            ExilePVPZoneMarkerPositions pushBack (getMarkerPos _x);
              ExilePVPZoneMarkerPositionsAndSize pushBack
          [
             getMarkerPos _x,
             (getMarkerSize _x) select 0
            ];
        };
    };
}
forEach allMapMarkers;
 

inPVPZone.sqf

Spoiler

private["_position","_result"];
_position = _this;
_result = false;
{
    if (((_x select 0) distance2D _position) < (_x select 1)) exitWith
    {
        _result = true;
    };
}
forEach ExilePVPZoneMarkerPositionsAndSize;
_result
 

isPVPZoneinRange.sqf

Spoiler

private["_position","_radius","_isInRange"];
_position = _this select 0;
_radius = _this select 1;
_isInRange = false;
{
    if ((_x distance2D _position) < _radius) exitWith
    {
        _isInRange = true;
    };
}
forEach ExilePVPZoneMarkerPositions;
_isInRange
 

onEnterPVPZone.sqf

Spoiler

private["_vehicle","_attachedObjects","_position"];
if (ExilePlayerInPVPzone) exitWith { false };
if !(alive player) exitWith { false };
ExilePlayerInPVPzone = true;
if !(_vehicle isEqualTo player) then
{
    if (local _vehicle) then
    {
        _vehicle allowDamage true;
    };
    
};

["ErrorTitleAndText", ["Entering PVP AREA !","First Person Only!"]] call ExileClient_gui_toaster_addTemplateToast;

true

Mybe someone can me give a hint what i did wrong its my first try to editing something (for me) bigger.

The View Restriction would look like this

Spoiler

if (!isDedicated) then {

    waitUntil {!isNull (findDisplay 46)};

    if ((difficultyOption "thirdPersonView")==1) then
    {
        while {true} do {

            waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};

            if (ExilePlayerInPVPzone) then {
                player switchCamera "INTERNAL";
            };
            sleep 0.1;

         };
    };

};

 

  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.