Jump to content
  • 0

Adding Right Click Ability Dependant on Humanity


seeker619

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;
Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 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"]
];
Link to comment
Share on other sites

  • 0
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];
};
Link to comment
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"];
}; 
Link to comment
Share on other sites

  • 0

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"];
}; 
Link to comment
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?

Link to comment
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?

 

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.

Link to comment
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. 

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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;

Link to comment
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 */
Link to comment
Share on other sites

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
  • Discord

×
×
  • Create New...