Jump to content
  • 0
lucho

Bunker only for Heroes

Question

 

How i can make that only hero with =>5000 humanity can get in?

///////////////////////////////////////////////////////////////////////////
if ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then {
    if (s_player_bunker < 0) then {
        s_player_bunker = player addaction[("<t color=""#0000ff"">" + ("In den Bunker") +"</t>"),"fixes\actions\bunkerin.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_bunker;
    s_player_bunker = -1;
};

 

if ( cursorTarget isKindOf "Infostand_2_EP1" && (player distance cursorTarget) < 2 ) then {
    if (s_player_bunkero < 0) then {
        s_player_bunkero = player addaction[("<t color=""#0000ff"">" + ("Lass mich raus!!!") +"</t>"),"fixes\actions\bunkerout.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_bunkero;
    s_player_bunkero = -1;
};
///////////////////////////////////////////////////////////////////////////

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
26 minutes ago, creativv said:

((player getVariable"humanity") >= 5000)

if  ((player getVariable"humanity") >= 5000)  && ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then {

 

thnaks

so is okey?

tested its not work

Share this post


Link to post
Share on other sites
  • 0

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

if ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then {
    if (s_player_bunker < 0) then {
        s_player_bunker = player addaction[("<t color=""#0000ff"">" + ("In den Bunker") +"</t>"),"fixes\actions\bunkerin.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_bunker;
    s_player_bunker = -1;
};

 

if ( cursorTarget isKindOf "Infostand_2_EP1" && (player distance cursorTarget) < 2 ) then {
    if (s_player_bunkero < 0) then {
        s_player_bunkero = player addaction[("<t color=""#0000ff"">" + ("Lass mich raus!!!") +"</t>"),"fixes\actions\bunkerout.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_bunkero;
    s_player_bunkero = -1;
};
///////////////////////////////////////////////////////////////////////////

} else {

titleText ["YOUR NOT HERO BLABLABLA!", "PLAIN DOWN", 3];
sleep 5;

};

Share this post


Link to post
Share on other sites
  • 0

Perhaps something like this?

_humanityrequired = 5000;


if ((player getVariable "humanity") < 5000) && ( cursorTarget isKindOf "Infostand_1_EP1" ) exitWith { cutText [format["You need atleast %1 humanity to access this trader",_humanityrequired], "PLAIN DOWN"]; };

 

Share this post


Link to post
Share on other sites
  • 0

If you can make a variable wich detects if the player is inside the bunker or outside the bunker you can make it even more neat .

Then you could make one section of code for both in and out with just one check for humanity .

Or use same script for in and out if thats possible , havent seen the scripts so cant tell but if they are simular you could try that .

Just a suggestion though .

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...