[Request] Player ID zone restriction and humanity restriction zone

Thx for the help so far, server is starting up with what Manatee Hunter sent pretty good and nobody gets stuck in "Wait for Host".
But somehow it doesn't seem to work properly or at all. It doesn't send any messages when I or a friend of mine enter that area. I have tried to set it to Skalisty Island on Chernarus und it looks like this:

mission.sqm:
Code:
    class Sensors
    {
        items=1;
        class Item0
        {
            position[]={13736.459960938,3000.3232421875,0};
            a=200;
            b=200;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist;";
            expActiv="adminbase = [] execVM ""Scripts\adminbase.sqf"";";
            expDesactiv="terminate adminbase; titleText [""You have left the Admin Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
                titleType="TEXT";
                titleEffect="PLAIN DOWN";
                title="You are entering a restricted zone.";
            };
        };
    };
};

adminbase.sqf:
Code:
if ((getPlayerUID player) in ["20014534"]) then {
titleText ["Hello Admin.  Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have 1 minute to turn back...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds to leave..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 30 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};

We are running a server on Dayz.st and Bliss if that helps in any way.
 
Would it be possible to modify epi pens to work if you have a specific humanity rating & while unconscious? - I mean being a hero is basically being a medic of the people... Might as well give em a few perks for being friendly and cooperating with others.

Also where are the move speeds editable?

Also wasn't able to get the BB to work with humanity requirements, this parts in my FN_selfactions.sqf

Code:
if ((PlayerHumanity < -12000) or (PlayerHumanity > 7000)) then {
s_action_blood = -1;
 
if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
    s_action_blood = player addAction ["Blood Bag Self", "scripts\bloodbag.sqf",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
    a_action_blood = 1;
};
if(s_action_blood > 0) then {
    player removeAction s_action_blood;
    s_action_blood = -1;
};
 
};

This is the Bloodbag.sqf I'm using

Code:
// bleed.sqf
_unit = (_this select 3) select 0;
_lowBlood =        _unit getVariable ["USEC_lowBlood", false];
_injured =        _unit getVariable ["USEC_injured", false];
_inPain =        _unit getVariable ["USEC_inPain", false];
 
player removeAction s_player_cook2;
s_player_cook2 = -1;
 
if (vehicle player == player) then {
    //not in a vehicle
    player playActionNow "Medic";
};
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
    _animState = animationState player;
    _isMedic = ["medic",_animState] call fnc_inString;
    if (_isMedic) then {
        _started = true;
    };
    if (_started and !_isMedic) then {
        r_doLoop = false;
        _finished = true;
    };
    if (r_interrupt) then {
        r_doLoop = false;
    };
    sleep 0.1;
};
r_doLoop = false;
 
if (_finished) then {
 
    if (_unit == player) then {
        //Self Healing
        _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
    } else {
        dayzHumanity = [player,50];
        _id = dayzHumanity spawn player_humanityChange;
    };
 
    _unit setVariable["USEC_lowBlood",false,true];
    player removeMagazine "ItemBloodbag";   
    usecTransfuse = [_unit,player];
    publicVariable "usecTransfuse";
} else {
    r_interrupt = false;
    [objNull, player, rSwitchMove,""] call RE;
    player playActionNow "stop";
};
 
It's possible, but I wouldn't know without trying it myself and at the moment I'm preparing for a survival weekend event and after that I'm working on my hospital healing script ... So possibly might get round to seeing about that after next week, if sooner then I'll let you know.
 
It's possible, but I wouldn't know without trying it myself and at the moment I'm preparing for a survival weekend event and after that I'm working on my hospital healing script ... So possibly might get round to seeing about that after next week, if sooner then I'll let you know.

All good, thanks
 
Thx for the help so far, server is starting up with what Manatee Hunter sent pretty good and nobody gets stuck in "Wait for Host".
But somehow it doesn't seem to work properly or at all. It doesn't send any messages when I or a friend of mine enter that area. I have tried to set it to Skalisty Island on Chernarus und it looks like this:

mission.sqm:
Code:
    class Sensors
    {
        items=1;
        class Item0
        {
            position[]={13736.459960938,3000.3232421875,0};
            a=200;
            b=200;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist;";
            expActiv="adminbase = [] execVM ""Scripts\adminbase.sqf"";";
            expDesactiv="terminate adminbase; titleText [""You have left the Admin Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
                titleType="TEXT";
                titleEffect="PLAIN DOWN";
                title="You are entering a restricted zone.";
            };
        };
    };
};

adminbase.sqf:
Code:
if ((getPlayerUID player) in ["20014534"]) then {
titleText ["Hello Admin.  Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have 1 minute to turn back...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds to leave..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 30 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};

We are running a server on Dayz.st and Bliss if that helps in any way.

I put the class Sensors code before Markers and after Vehicles - that made it work for me.

My co-ords were in this format - position[]={5782.6616,0,1860.5177};
 
I put the class Sensors code before Markers and after Vehicles - that made it work for me.

My co-ords were in this format - position[]={5782.6616,0,1860.5177};

Alright, does that position format differ from what I find in the database? I jsut took me characters position on the middle of skalisty. Could that be a problem?
 
Player walks past the set position (set to be a radius of 20 (by the a=20 and the b=20)

It triggers a sound Sirene_EP1 and alerts zombies within 150m.

I didn't come up with this, someone else on the forums did. I just thought I'd give it a try go and place it on top of 5 of the fuel points on my map.
 
Alright, does that position format differ from what I find in the database? I jsut took me characters position on the middle of skalisty. Could that be a problem?

Yes, the format the editor uses differs from the database. Do you know how to use the editor?
 
Could this work ?

I want them to be able to heal them self when they meet the targets but to be able to bloodbag others before that lie the normally would.
Do I even need the else part ?

Code:
if ((getPlayerUID player) in ["xxxxxx","xxxxxx"]) or (PlayerHumanity < -12000) or (PlayerHumanity > 7000)) then {
        s_action_blood = -1;
 
        if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
            s_action_blood = player addAction ["Use Bloodbag", "scripts\bloodbag.sqf",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
            a_action_blood = 1;
        };
        if(s_action_blood > 0) then {
            player removeAction s_action_blood;
            s_action_blood = -1;
        }
} else {
        s_action_blood = -1;
 
        if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
            s_action_blood = player addAction ["Use Bloodbag",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
            a_action_blood = 1;
        };
        if(s_action_blood > 0) then {
            player removeAction s_action_blood;
            s_action_blood = -1;
       
        }
};
 
Could this work ?

I want them to be able to heal them self when they meet the targets but to be able to bloodbag others before that lie the normally would.
Do I even need the else part ?

Code:
if ((getPlayerUID player) in ["xxxxxx","xxxxxx"]) or (PlayerHumanity < -12000) or (PlayerHumanity > 7000)) then {
        s_action_blood = -1;
 
        if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
            s_action_blood = player addAction ["Use Bloodbag", "scripts\bloodbag.sqf",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
            a_action_blood = 1;
        };
        if(s_action_blood > 0) then {
            player removeAction s_action_blood;
            s_action_blood = -1;
        }
} else {
        s_action_blood = -1;
 
        if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
            s_action_blood = player addAction ["Use Bloodbag",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
            a_action_blood = 1;
        };
        if(s_action_blood > 0) then {
            player removeAction s_action_blood;
            s_action_blood = -1;
     
        }
};

I did not manage to get the humanity based blood bag to work, if you do - post it
 
Regarding the self-bloodbag with humanity/admin prerequisites:

I only tested this one shortly, but seems to work without trouble.
To remove the addAction menu make sure you add the remove function at the end of the bloodbag script as well.

I can hook up both file contents I used to try that out as well:

Code for fn_selfactions.sqf
Code:
PlayerHumanity = (player getVariable"humanity");
if ((getPlayerUID player) in ["123456","234567"] or (PlayerHumanity > 14999)) then {
s_action_blood = -1;
 
if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
        s_action_blood = player addAction ["Blood Bag Yourself", "code\bloodbag.sqf",[player], 0, false, true, "", "'ItemBloodbag' in magazines player"];
        a_action_blood = 1;
};
if(s_action_blood > 0) then {
        player removeAction s_action_blood;
        s_action_blood = -1;
};
};

Code for bloodbag.sqf
Code:
_unit = (_this select 3) select 0;
_lowBlood =        _unit getVariable ["USEC_lowBlood", false];
_injured =        _unit getVariable ["USEC_injured", false];
_inPain =        _unit getVariable ["USEC_inPain", false];
 
player removeAction s_player_cook2;
s_player_cook2 = -1;
 
if (vehicle player == player) then {
    //not in a vehicle
    player playActionNow "Medic";
};
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
    _animState = animationState player;
    _isMedic = ["medic",_animState] call fnc_inString;
    if (_isMedic) then {
        _started = true;
    };
    if (_started and !_isMedic) then {
        r_doLoop = false;
        _finished = true;
    };
    if (r_interrupt) then {
        r_doLoop = false;
    };
    sleep 0.1;
};
r_doLoop = false;
 
if (_finished) then {
 
    if (_unit == player) then {
        //Self Healing
        _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
    } else {
        dayzHumanity = [player,50];
        _id = dayzHumanity spawn player_humanityChange;
    };
 
    _unit setVariable["USEC_lowBlood",false,true];
    player removeMagazine "ItemBloodbag";
    usecTransfuse = [_unit,player];
    publicVariable "usecTransfuse";
} else {
    r_interrupt = false;
    [objNull, player, rSwitchMove,""] call RE;
    player playActionNow "stop";
};
player removeAction s_action_blood;

Fiddled a bit more around with it and seems it doesnt remove the addAction correctly if you're having more bloodbags in your inventory.
Guess that was why the original script does have a "lastUsed" variable to integrate some sort of cooldown before having it check again for another addAction option due to lost blood.

Will need to look more into it tomorrow and will post back once I did, meanwhile this works fine besides the option to bloodbag yourself again even though youre full health.
 
So would this be what it could look like?

HeroBase.sqf

Code:
PlayerHumanity = (player getVariable"humanity");
if (PlayerHumanity > 12000) then {
titleText ["Hello Hero.  Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a Hero only zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have 1 minute to turn back...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds to leave..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 30 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};

So would this be what it could look like?

And for the mission will this work?

Code:
        class Item5
        {
            position[]={12186.046,0,12218.783};
            a=300;
            b=300;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="HeroBase";
            expCond="(vehicle player) in thislist;";
            expActiv="HeroBase = [] execVM ""Scripts\HeroBase.sqf"";";
            expDesactiv="terminate HeroBase; titleText [""You have left the Hero Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
                titleType="TEXT";
                titleEffect="PLAIN DOWN";
                title="You are entering a restricted zone.";
            };
        };

Arghhhhh, why dont i get this to work? :( Been struggling for two days now!
Would you please, please help me out? I dont know if im doing the position wrong or whatever, my head is exploding. Please do contact me some way, i would be more than happy, and could not thank you enough.
 
Ok got it to work with this in the "fn_selfAction.sqf"

Code:
PlayerHumanity = (player getVariable"humanity");
if ((getPlayerUID player) in ["123456","234567"] or (PlayerHumanity < -12000) or (PlayerHumanity > 7000)) then {
s_action_blood = -1;
 
if(r_player_blood < 12000 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
        s_action_blood = player addAction ["Blood Bag Yourself", "scripts\bloodbag.sqf",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
        a_action_blood = 1;
};
if(s_action_blood > 0) then {
        player removeAction s_action_blood;
        s_action_blood = -1;
};
};

together wiht the info from this thread
http://opendayz.net/index.php?threads/help-bloodbag-yourself.7443/#post-28141
and this thread
http://www.tunngle.net/community/topic/108901-dayz-bloodbag-yourself-code/

I used the bloodbag script and the fn_selfAction script from those, and changed the bloodbag part to the code above :)
 
To remove the menu option after blooding yourself I changed the line commented " // I changed this line " to check whether the players blood was above a certain level, then remove the menu. As the original code didn't do that and I honestly can't figure out how else to do it. You'll also see that I've made it so the players blood must be below 7500 to give the option and above 7500 before the menu option is removed. I also moved " s_action_blood = -1; " to the dayz_code variables file, as I use that a lot anyway for custom zombie spawn rates etc..

Code:
PlayerHumanity = (player getVariable"humanity");
if ((getPlayerUID player) in ["123456","234567"] or (PlayerHumanity < -12000) or (PlayerHumanity > 7000)) then {
 
// s_action_blood = -1; (I moved this line to the variables.sqf file, but maybe it will still work if you leave it)
 
if(r_player_blood < 7500 and "ItemBloodbag" in magazines player and s_action_blood < 0) then {
        s_action_blood = player addAction ["Blood Bag Yourself", "scripts\bloodbag.sqf",[player], 0, true, true, "", "'ItemBloodbag' in magazines player"];
        a_action_blood = 1;
};
if(r_player_blood > 7500) then {  // I changed this line
        player removeAction s_action_blood;
        s_action_blood = -1;
};
};

Added: I also added some code to prevent players from blood bagging while in combat, which I think makes it a more acceptable feature of the game now. Doesn't it? :p

Add this to a if exit with statement in the bloodbag.sqf file , or wherever you want to put it..
Code:
(player getVariable["combattimeout", 0] >= time)
 
Hey Urban,

I been thinking about adding more things to the list of stuff I'd require players to have humanity to have access to.

Right now I'm using FP lock in helis for Celle (it's a flat map, helis are OP with 3rd person). This here is in my init.sqf and that's it. I also wanted to do it to PixeLs dogs, force ppl to be a hero to get one.

Code:
//1st person lock in Air Vehicles
if (!isDedicated) then
{
    0 spawn
    {
        while {true} do
        {
            if((cameraView == "EXTERNAL" || cameraView == "GROUP") && (vehicle player isKindOf "Air")) then
            {
                vehicle player switchCamera "INTERNAL"; titleText["This type of vehicle is 1st Person only!!", "PLAIN DOWN", 5]
            };
        sleep 0.1;
        };
    };
};
 
Hey Urban,

I been thinking about adding more things to the list of stuff I'd require players to have humanity to have access to.

Right now I'm using FP lock in helis for Celle (it's a flat map, helis are OP with 3rd person). This here is in my init.sqf and that's it. I also wanted to do it to PixeLs dogs, force ppl to be a hero to get one.

That's pretty cool dood. I've now given the bloodbag to everyone, but you can't use it until you're below 7500 blood and not while you're in combat. Even my hardcore players are saying its a cool feature.. Happy coding dood :D
 
Back
Top