Jump to content
  • 0
seeker619

Adding Right Click Ability Dependant on Humanity

Question

So i want to add A right click ability for bandits with -40,000 Humanity or less, that will allow right clicking of GPS to scan for players in the area..

Im having a hard time figuring out where and how to put in the humanity check in, and which script i can put it in.

 

Heres a section of the "Clickables Script im using" (dont know original coder, sorry.):

//  DZE_CLICK_ACTIONS
//      This is where you register your right-click actions
//  FORMAT -- (no comma after last array entry)
//      [_classname,_text,_execute,_condition],
//  PARAMETERS
//  _classname  : the name of the class to click on
//                  (example = "ItemBloodbag")
//  _text       : the text for the option that is displayed when right clicking on the item
//                  (example = "Self Transfuse")
//  _execute    : compiled code to execute when the option is selected
//                  (example = "execVM 'my\scripts\self_transfuse.sqf';")
//  _condition  : compiled code evaluated to determine whether or not the option is displayed
//                  (example = {true})
//  EXAMPLE -- see below for some simple examples

DEPLOY_BIKE = [
  ["ItemToolbox","Deploy Bike","[] execVM 'scripts\spawnbike\deploy_init.sqf';","true"]
];
CAREPACKAGESELF = [
  ["ItemBriefcase100oz","Call Carepackage (On Self)","[] execVM 'scripts\Carepackage\carepackage.sqf';","true"]
];
DZE_CLICK_ACTIONS = DEPLOY_BIKE + CAREPACKAGESELF;

Below is how i THINK i could do it.

_isbandit = (player getVariable ["humanity",0] < -40000);

DEPLOY_BIKE = [
  ["ItemToolbox","Deploy Bike","[] execVM 'scripts\spawnbike\deploy_init.sqf';","true"]
];

CAREPACKAGESELF = [
  ["ItemBriefcase100oz","Call Carepackage (On Self)","[] execVM 'scripts\Carepackage\carepackage.sqf';","true"]
];

if (_isbandit) then {

BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","true"]
];

} else {
    BANDIT_GPS = [];

DZE_CLICK_ACTIONS = DEPLOY_BIKE + CAREPACKAGESELF + BANDIT_GPS;

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0
_condition  : compiled code evaluated to determine whether or not the option is displayed

 

BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","player getVariable['humanity',0] > -5000;"]
];

Share this post


Link to post
Share on other sites
  • 0
BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","player getVariable['humanity',0] > -5000;"]
];

is the > facing the wrong way?? the way you have it wouldnt it look for -5000 Humanity and up so even 0 humanity and heroes would get it?? Say i wanted it for -40k humanity and LESS. would it be:

BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","player getVariable['humanity',0] < -40000;"]
];

Is the end of that correct with the ; before the qoute?? does the ; even need to be in there?

I.E.

BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","player getVariable['humanity',0] < -40000"]
];

Share this post


Link to post
Share on other sites
  • 0
Guest
private ['_isBandit','_gpsArray','_carepackage'];

//Returns true or false
_isBandit = player getVariable['humanity',0] < -40000;
//Note: DZE Click Actions is an array itself, therefore this can't be inside an array:

//right
_gpsStuff = ["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","true"]; 

//wrong
//BANDIT_GPS = [["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","true"]];

//Exit the Script, if is Bandit, as it won't be appended anyway, if not bandit.. 
//If you want to add more stuff, before exiting the Script, do it like so:

//_carepackage = ["ItemBriefcase100oz","Call Carepackage (On Self)","[] execVM 'scripts\Carepackage\carepackage.sqf';","true"];
//DZE_CLICK_ACTIONS set [count DZE_CLICK_ACTIONS, _carepackage];

if (_isBandit) exitWith {
	DZE_CLICK_ACTIONS set [count DZE_CLICK_ACTIONS, _gpsStuff];
};

Share this post


Link to post
Share on other sites
  • 0

 

trying now as

BANDIT_GPS = [
["ItemGPS","Scan Area","[] execVM 'scripts\BanditPerks\bandit.sqf';","player getVariable['humanity',0] < -40000"]
];

Ok so the above works, i get the right click ability pop up if my humanity is below -40k, and no pop up option if its above.   But when i click Scan Area nothing happens.. heres the scan script.

/*
Player count in area script by FragZ & Zupa
You can make this script execute over action menu or with right-click option in the extra_rc.hpp
You can also execute it over a trigger to make a pvp zone that counts participants!
*/

// Config
_allowedDistance = 1500; 
_allowedAfterTime = 60000; // 1000 = 1 sec, 5*60*1000 = 300000
// Config End

if(isNil "LastUsedCheck")then{
LastUsedCheck = 0;
};

if( LastUsedCheck == 0 || (diag_tickTime-LastUsedCheck)>_allowedAfterTime)then{

_playercount = count (player nearEntities ["CAManBase", _allowedDistance ]); // only gets people, not all vehicles, besides, i think people are not in the ALLVechicle variable xp
 
uisleep 3;

if (_playercount == 0) then {
cutText ["You are currently the only human within 1500m of you.", "PLAIN DOWN"];
};
if (_playercount = 1) then {
cutText ["There is one other human within 1500m of you.", "PLAIN DOWN"];
};
if (_playercount > 1) then {
cutText [format["There are %1 within 1500m of you!",_playercount], "PLAIN DOWN"];
};
LastUsedCheck = diag_tickTime;
}else{
cutText [format["You can not use this now. Available in %1 sec.",(_allowedAfterTime  - (diag_tickTime-LastUsedCheck))/1000], "PLAIN DOWN"];
}; 

Share this post


Link to post
Share on other sites
  • 0
Guest

I can't really find anything wrong with that, except that it needs some spaces ^^

Try just seeing, if the File is actually opening or not, by adding a Systemchat Line:

/*
	Player count in area script by FragZ & Zupa
	You can make this script execute over action menu or with right-click option in the extra_rc.hpp
	You can also execute it over a trigger to make a pvp zone that counts participants!
*/

systemchat "[DEBUG] I'm in the File!";

_private ['_allowedDistance','_allowedAfterTime','_playercount','_playercountVeh','_veh'];

// Config
_allowedDistance = 1500; 
_allowedAfterTime = 60000; // 1000 = 1 sec, 5*60*1000 = 300000
// Config End

if (isNil "LastUsedCheck") then {
	LastUsedCheck = 0;
};

if (LastUsedCheck == 0 || (diag_tickTime-LastUsedCheck) > _allowedAfterTime) then {

	_playercount = count ((position player) nearEntities ["CAManBase", _allowedDistance ]); // only gets people, not all vehicles, besides, i think people are not in the ALLVechicle variable xp
	_playercountVeh = (position player) nearEntities ["AllVehicles", _allowedDistance ];
	if (count _playercountVeh > 0) then {
		{
			_veh = _x;
			if (count (crew _veh) > 0) then {
				{
					if (alive _x && isPlayer _x) exitWith {_playercount = _playercount + 1;};
				} count (crew _veh);
			};
		} count _playercountVeh;
	};
	 
	//uisleep 3; Sleep is not allowed here

	call {

		if (_playercount = 1) exitWith {cutText ["There is one other human within 1500m of you.", "PLAIN DOWN"];}
		
		if (_playercount > 1) exitWith {cutText [format["There are %1 within 1500m of you!",_playercount], "PLAIN DOWN"];};
		
		cutText ["You are currently the only human within 1500m.", "PLAIN DOWN"];
	};

	LastUsedCheck = diag_tickTime;

} else {
	cutText [format["You can not use this now. Available in %1 sec.",((_allowedAfterTime  - (diag_tickTime-LastUsedCheck))/1000)], "PLAIN DOWN"];
}; 

Share this post


Link to post
Share on other sites
  • 0

Nice, i never even thought about adding a system chat to files to see if they are being opened.. simple, but nice tip.. ill try that..

 

quick question. 

 

systemchat  is displayed lower left corner, right?

cuttext , is displayed in the center?

 

what other ones are there?

Share this post


Link to post
Share on other sites
  • 0
Guest

Nice, i never even thought about adding a system chat to files to see if they are being opened.. simple, but nice tip.. ill try that..

 

quick question. 

 

systemchat  is displayed lower left corner, right?

cuttext , is displayed in the center?

 

what other ones are there?

 

Well you got for the bottom left corner: systemchat, group chat, direct chat, global chat, admin chat - basically all chats when you press . or ,

For the Middle you got, CutText, titleCut and titleText.

For the middle right you got hint and hintsilent,

For everywhere you got dynamicText and cutRSC.

Share this post


Link to post
Share on other sites
  • 0

Well you got for the bottom left corner: systemchat, group chat, direct chat, global chat, admin chat - basically all chats when you press . or ,

For the Middle you got, CutText, titleCut and titleText.

For the middle right you got hint and hintsilent,

For everywhere you got dynamicText and cutRSC.

 

CutText, titleCut, titleText, hint, hintsilent, dynamicText and cutRSC.:  Do each one appear differently? as in, color and text size? If so how do they look?

 

 

Thanks for the pointer, tips, answers. 

Share this post


Link to post
Share on other sites
  • 0
Guest

Hint is used for debug monitors, it displays a message Box with a brownish background on the right side of Screen, also plays a Sound. Hintsilent does the same, but without sound. For both you can choose Text Colour, Text Size, Text Font. Can also contain Images.

 

cutText, titleCut and titleText do literally the same, a white Text in the Middle of screen. I'm not sure how all of those work, as i never use them, but i guess you can't customize the colours, etc.

DynamicText spawns a Text anywhere you want, you can choose the Position yourself. You can also Choose Text Colour, Text Size and Text Font.

cutRSC displays a custom made box, that you'll have to create in your description.ext first (i wouldn't recommend doing this, as long as you don't have some sort of knowledge base). This grants you all possibilities, size, colour, background, images etc..

Share this post


Link to post
Share on other sites
  • 0
Guest

ya when i right click the gps and click scan, it will say [DEBUG] I'm in the File!, everytime i click.. but no scan is happening.

 

Are you using infiSTAR? If so, set _TCT = false;  in your Settings and _UCS = true;

Share this post


Link to post
Share on other sites
  • 0

Are you using infiSTAR? If so, set _TCT = false;  in your Settings and _UCS = true;

dont have a _TCT setting, ya infistar

/*  DebugMonitor Key      */ _ODK =  0xCF;    /* google DIK_KeyCodes (0xCF is END) */
/*  Use DebugMonitor      */ _DMS =  false;    /* true or false */    /* starts up with debugmonitor ON if true */
/*  DebugMonitor Action   */ _DMW = false;    /* true or false */    /* "Debug" option on mousewheel */
/*  Mod EPOCH ?           */ _MEH =  true;    /* true or false */
/* ********************************************************************************* */
/*  Use AUTOBAN HACKER    */ _UAB =  true;    /* true or false */    /* recommended:  true */    /* temp bans are cleared after a server restart */
/*  Enable BadKey Kick    */ _BKK =  false;    /* true or false */    /* recommended:  true */    /* If people press a forbidden Key twice, they get kicked! */
/*  Forbid VON Sidechat   */ _VON =  true;    /* true or false */    /* recommended:  true */    /* talking on sidechat will put out a warning and kick if continue */

/*  Allow RE functions    */ _ARF =  true;    /* true or false */    /* recommended:  true */    /* e.g. white text for killmessages/combatlogging */
/*  Break Functions ?     */ _BHF =  false;    /* true or false */    /* recommended:  true */    /* break some known functions used by hacks! */
/*  Use vehicle check?    */ _UVC = false;    /* true or false */    /* recommended: false */    /* using _ALLOWED_Vehicles and _FORBIDDEN_Vehicles lists */
/*  Use zombie check?     */ _UZC =  false;    /* true or false */    /* recommended:  true */    /* "Walk Amongst The Dead" needs this set to false */
/*  Vehicle WHITELIST     */ _UVW = false;    /* true or false */    /* recommended: false */    /* if false - _ALLOWED_Vehicles won't not be used */
/*  Vehicle Tradercheck   */ _VTC =  false;    /* true or false */    /* recommended:  true */    /* checks if a player is near a trader when 'purchasing' a vehicle */
/*  Vehicle ValidId ?     */ _UIC =  false;    /* true or false */    /* recommended:  true */    /* checks if ids on a vehicle are valid or not */

/*  Cheatengine Checks ?  */ _UCC =  true;    /* true or false */    /* recommended:  true */    /* certain strings have been changed */
/*  Use FileScan ?        */ _UFS =  true;    /* true or false */    /* recommended:  true */    /* spams the rpt but often finds hackers */
/*  Use Anti Teleport?    */ _UAT =  false;    /* true or false */    /* recommended:  true */    /* true = teleports them back, false = only logging */
/*  Use cut-scene ?       */ _UCS =  true;    /* true or false */    /* recommended:  true */    /* dynamicText ~ often colored, animated or used in credits */
/*  Use Damage Check ?    */ _UDC =  true;    /* true or false */    /* recommended:  true */    /* try to catch Hacks that change the damage value of weapons */

/*  Remove "itemsAdded"   */ _RAI =  false;    /* true or false */    /* recommended:  true */    /* might remove items from a custom crafting system.. */
/*  HACKED BOX Check ?    */ _CHB =  false;    /* true or false */    /* recommended:  true */    /* some epoch player might want to turn this one off */
/*  Max Cargo Count ?     */ _MCC =  650;

/*  Close Dialogs ?       */ _CUD =  false;    /* true or false */    /* recommended:  true */    /* Closes custom Dialogs (Menus) that are not in _ALLOWED_Dialogs */
/*  Remove Keybinds ?     */ _RCK =  false;    /* true or false */    /* recommended:  true */    /* Removes custom Keybinds and sets back the default ones */
/*  Check CMDMenus ?      */ _CCM = false;    /* true or false */    /* recommended:  true */    /* only disable this if you know what you are doing. */
/*  BLOCK ALL CMDMenus    */ _BCM = false;    /* true or false */    /* recommended:  true */    /* we don't need commandingMenus. so have this true. */
/*  Check Actions ?       */ _CSA = false;    /* true or false */    /* recommended: false */    /* this checks mousewheel actions */
/*  Force Terrain Grid ?  */ _FTG =    25;    /* 50, 25, 12.5  */    /* recommended:    25 */    /* if set to 50 grass will be very low for better client FPS */

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...

  • Similar Content

    • By velvetchaos
      Hi all, I've been looking through the posts trying to find a build script like the one piggd uses on their servers.  The one I'm talking about is a scroll menu when clicked, it opens up a build window with buildings, nav piers, etc.  In the window, it tells you what mats are needed to build each thing ie; 6 wire fence, 4 cement, 4 cinder blocks, scrap metal etc.   If the script mod is posted somewhere, I have yet to find it.  So, if anyone knows what script I'm talking about and can point me to where it is posted (if it is available?) it would be appreciated.
       
      Thanks
    • By Tricks
      Hello community,
       
      With a lot of hard work and amazing help from GZA, we were able to get Virtual Garage to work on our hosted test server. Here is the link to his awesome script https://seafile.zomb...u/d/1cdde343bd/! GZA uses  deploy his garages. I don't want to use this large script for just this single reason.
       
      I was hoping someone in this awesome community with the knowledge of scripting would be able to develop an addon that would allow the following:
       
      1) Allow the item to be purchased from a trader eg. gem.
       
      2) Deployment of: 
      Land_MBG_Garage_Single_A
      Land_MBG_Garage_Single_B
      Land_MBG_Garage_Single_C
      Land_MBG_Garage_Single_D
      Helipad
       
      3) Allow the player to adjust positioning of the garage or helipad before placement.
      4) Have the item consumed after garage or helipad is placed.
       
      I can't wait to see if someone is able to come up with something that works. This could be a great way to help with database performance by reducing the amount of cars on the server. Also help reduce the complaints of players vehicles "disappearing". Thanks in advance!!
    • By MattL
      What this does:
       
      It spawns a carepackage above the player that floats down around the player. It can be filled with whatever you want. By default the carepackage costs two brief cases to buy.
       
       
      Using http://epochservers.com/viewtopic.php?f=14&t=13 add this to your extra_rc.hpp 
      class ItemBriefcase100oz { class carepackage { text = "Call carepackage"; script = "execVM 'scripts\carepackage.sqf'"; }; }; change the filepath as necessary. 
       
      Now find the hacker check in your server_functions.sqf and replace 
      if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then { with
      if(vehicle _x != _x && (vehicle _x getVariable ["Mission",0] != 1) && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x) && !((typeOf vehicle _x) in DZE_safeVehicle)) then { save and repack. 
       
      Download link - contains all three versions. for any of the map click versions you will need to make the extra_rc point to the clickpackage.sqf
      You can change the _cost (how many briefs it requires), you can change the _distance until the box is deleted, you can change the _smoke color, you can change the items and weapon types also. You can change the way the box is arranged on the chute, but I wouldn't touch it as it can mess with the chute or make the box float above the ground. You can also change the height that the carepackage spawns at, on line 23 
      _position = [_getPos select 0, _getPos select 1, 25]; change the 25 at the end. 
       
      EDIT: You may have to whitelist a few things in the createvehicle.txt like 
      !="USVehicleBox_EP1" !="ParachuteMediumEast" !="SmokeShellBlue" I don't use BE personally so I can't really help any more than that.
       
      and
       
      If you are running infistar antihack remove: onMapSingleClick ''; from AH.sqf  
       
      Enjoy.
       
      To view a video of this system click HERE
       
      If you like the script, please consider donating below.
       
       
      Credits : Infistar, he helped majorly with weapon mag selection. 
    • By speaR
      Good Evening guys. I got some problems getting macas right click options to work on my server.: http://epochservers.com/viewtopic.php?f=14&t=13 . In his tutorial he's talking about compiles.sqf . Do I have to create an custom one in my mission folder? Or is it the one in the .pbo\init etc. Do I have to create an own compiles.sqf in my missions folder? If I have to.. How is it done? Same with ui_selectSlot.sqf . Does anyone knows a tutorial for noobs like me in scripting. (But already learned a lot of you helpful guys in this forum :-) ) so could anyone make me a bit more detailed description of how to gut it working.. Have a nice day !
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...