HERO / BANDIT Bases

bajaboy1972

Well-Known Member
Don't know if this has been covered before. What im looing to do is add a protective dome over each base.....but instead of killing players who aren't added by their uid I want to allow players in bases based on their humanity. So if a player is a bandit he is automatically allowed in bandit base but will die if they try and enter a hero base (based on certain set time ) and visa versa .The below code is currently what I use but is based on uid's being manually added.

Code:
if ((getPlayerUID player) in ["123456789"]) then {
titleText ["Hello Player.  Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering an Admin Base, please turn back now or DIE!!!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have 25 seconds to turn back...", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have less than 20seconds to leave..", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have less than 15 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 5;
titleText ["You have less than 10 seconds to leave (You're about to die!)...", "PLAIN DOWN", 3];
sleep 5;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};


This is activated by this code....

Code:
This is activated by this code....
 
class Sensors
{
items=7;
class Item0
{
position[]={8109.0664, -0.00017738342, 7633.4717};
a=350;
b=350;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="AdminBase_1";
expCond="(vehicle player) in thislist";
expActiv="adminbase = [] execVM ""domes\adminbase.sqf"";";
expDesactiv="terminate adminbase; titleText [""You have left the admin Base!"", ""PLAIN DOWN"", 3];";
class Effects
{
};
};

Any help would be greatly appreciated
 
Hey Man, I just figured this one out this week.

First of all after you place the name of each base sqf files into your main pbo. Use the 2D Map editor to set up the trigger by pressing F3.

Heres the code I use for the Hero Base it removes weapons at 30 seconds and kills a player at 1 minute.

Code:
PlayerHumanity = (player getVariable"humanity");
if (PlayerHumanity > 5000) then {
titleText ["You are now entering hero base.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back, you will be killed!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["Have a nice day!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};

Remember to change the > sign to point in the right direction for bandits so it be PlayerHumanity < -5000 so is less than.

To set up the triggers click on them in the editor, set activation by [ anybody- repeatedly]

NAME: herobase

CONDITON: (vehicle player) in thislist;

ON ACT: herobase = [] execVM "map\herobase.sqf";

ON DEA: terminate herobase; titleText ["You left the restricted area.", "PLAIN DOWN", 3];



I'M SURE THIS WILL HELP YOU! GOOD LUCK!


This is not my code, but I forgot where I got it. :(
 
Tried the code you posted....trigger is working because I get exit text....but the entrance (bandit or hero .sqf ) are no being activated. Any idea ?
 
make sure the names are all set up. Make sure the spelling of your files and the directorys are correct


mines at "maps\herobase.sqf"

I use the 2D map editor to set up the triggers. Much easier, can't mess anything up that way. Jus make sure you set up the triggers like I said. Set to ANYBODY, and REPEAT!
 
This is my bandit.sqf


Code:
if (isPlayer _x) && ((_x getVariable ["humanity",0]) < 0) then {
titleText ["You are now entering Bandit base.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a Bandit Base, turn back!", "PLAIN DOWN", 3];
sleep 10;
titleText ["This a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 10;
titleText ["You've got Balls Son!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 10;
titleText ["Your weapons have been removed!", "PLAIN DOWN", 3];
sleep 10;
titleText ["You made a very bad decision!", "PLAIN DOWN", 3];
sleep 10;
titleText ["You will be executed!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};


And this is my trigger......
Code:
class Item1
  {
   position[]={2051.29, 247.001, 11721.5};
   a=150;
   b=150;
   angle=-10.7374;
   rectangular=1;
   activationBy="ANY";
   repeating=1;
   interruptable=1;
   age="UNKNOWN";
   name="playerbase_1";
   expCond="(vehicle player) in thislist";
   expActiv="playerbase = [] execVM ""domes/bandit.sqf"";";
   expDesactiv="terminate playerbase; titleText [""You have left the Bandit Base!"", ""PLAIN DOWN"", 3];";
   class Effects
   {
   };
  };
 
HERES YOUR BANDIT SQF

PlayerHumanity = (player getVariable"humanity");
if (PlayerHumanity < -5000) then {
titleText ["You are now entering bandit base.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You are entering a restricted area, turn back, you will be killed!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You are entering a restricted area, turn back!", "PLAIN DOWN", 3];
sleep 15;
titleText ["Have a nice day!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};
 
hey guys.

BOTH these two variables do not work for me:

PlayerHumanity = (player getVariable"humanity");
if (PlayerHumanity < -5000) then {

if (isPlayer _x) && ((_x getVariable ["humanity",0]) < 0) then {

The zone is definitely set up correctly as when i LEAVE the area i get the msg saying that i have left the zone however there is no msg on entering the zone which leads me to believe that the variables are not working.
Can anyone confirm if this is working on 1.7.7.1?

Thanks,


John
 
This works for sure. I've used it recently.
Code:
PlayerHumanity = (player getVariable"humanity");
if (PlayerHumanity > 0) then {
titleText ["Hi there survivor! You are entering the Hero Outpost.", "PLAIN DOWN", 3];
sleep 5;
titleText ["This is a friendly zone!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You may take any supplies you need from our tents.", "PLAIN DOWN", 3];
sleep 5;
titleText ["Enjoy your stay. You are welcome here any time.", "PLAIN DOWN", 3];
} else {
titleText ["This is a hero only zone. Get out you filthy bandit!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have 10 seconds to leave.", "PLAIN DOWN", 3];
sleep 10;
player setpos [12305.5, 12552];
};
 
If you wanted to have different messages for Heroes, Bandits and Survivors in one zone something like this would work.
_isBandit = (player getVariable["humanity",0]) <= -2500;
_isHero = (player getVariable["humanity",0]) >= 5000;

if (_isBandit) then {//bandit message
cutText ["custom message to bandit", "PLAIN DOWN"];
};
if (!_isHero and !_isBandit) then {//survivor message
cutText ["custom message to survivor", "PLAIN DOWN"];
};
if (_isHero) then {//hero message
cutText ["custom message to hero", "PLAIN DOWN"];
};

and of course you could add other actions inside those as well

if you only wanted it do display a message for a hero and have a standard message for everyone else then this would work, obviously interchangeable with bandits and survivors

_isHero = (player getVariable["humanity",0]) >= 5000;
if (_isHero) then{
cutText ["custom message to hero", "PLAIN DOWN"];
}else{
cutText ["custom message to non heroes", "PLAIN DOWN"];
};

hope that helps :)
 
Back
Top