Jump to content
  • 0

Humanity Board


Robert261171

Question

12 answers to this question

Recommended Posts

  • 0
On 24/4/2017 at 2:35 PM, Robert261171 said:

Thanks guys, would really appreciate if you can help me on this, 

maybe you can start to test with an adaptation of noxsicarius teleport to player script.

phum.sqf (mpmissions\yourinstance\humanity\)

Spoiler

private["_max","_j","_menuCheckOk"];
_menuCheckOk = false; _max = 10; _j = 0;
snext = false; plist = []; pselect5 = "";

pMenuTitle = "";
	fn_smenu =
	{
		private["_pmenu"];
		_pmenu = [["",true],[pMenuTitle, [-1], "", -5, [["expression", ""]], "1", "0"]];
		for "_i" from (_this select 0) to (_this select 1) do
		{_arr = [format['%1', plist select (_i)], [12],  "", -5, [["expression", format ["pselect5 = plist select %1;", _i]]], "1", "1"]; _pmenu set [_i + 2, _arr];};
		if (count plist > (_this select 1)) then {_pmenu set [(_this select 1) + 2, ["Next", [13], "", -5, [["expression", "snext = true;"]], "1", "1"]];}
		else {_pmenu set [(_this select 1) + 2, ["", [-1], "", -5, [["expression", ""]], "1", "0"]];};
		_pmenu set [(_this select 1) + 3, ["Exit", [13], "", -5, [["expression", "pselect5 = 'exit';"]], "1", "1"]];
		showCommandingMenu "#USER:_pmenu";
	};



{
if ((_x != player) && (getPlayerUID _x != "")) then {
plist set [count plist, name _x];
};
} forEach entities "CAManBase";



pMenuTitle = "WANTED";

while {pselect5 == "" && !_menuCheckOk} do {
	[_j, (_j + _max) min (count plist)] call fn_smenu; _j = _j + _max;
	WaitUntil {pselect5 != "" || snext || commandingMenu == ""};
	_menuCheckOk = (commandingMenu == "");
	snext = false;
};

if (pselect5 != "exit") then
{
	_name = pselect5;
	
	{
		if(name _x == _name) then
		{
		_hum = _x getVariable['humanity', 0];
		titleText[format["This player have %1 of humanity", _hum],"PLAIN DOWN"];
        };
  } forEach entities "CAManBase";
};

 

 2-custom fn_selfaction

find:

if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {

above paste:

//gethum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {
if (s_player_ph < 0) then {
            s_player_ph = player addaction[("<t color=""#F7D708"">" + ("GetPlayersHumanity") +"</t>"),"humanity\phum.sqf"];
        };

    } else {
        player removeAction s_player_ph;
        s_player_ph = -1;
    };

find:

} else {
    //Engineering

below paste:

player removeAction s_player_ph;
        s_player_ph = -1;

EDIIT;

Also you will need in your custom variables.sqf

Spoiler

find this:


dayz_resetSelfActions = {

add below


s_player_ph = -1;

 

the // Weapons neutral trader gonna take the humanity script. use the scroll menu on he.

change the id to give the option to another trader.

Link to comment
Share on other sites

  • 0

I was thinking of a board rather then a trader, 

Ive done a board for linzburg trader,

_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["WarfareBunkerSign", [8237.1494, 15476.086, 0.020662732], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setDir -129.80498;
  _this setVehicleInit "this setObjectTexture [0, ""IMG\Humanity\Humanity.jpg""]";
  _this setPos [8237.1494, 15476.086, 0.020662732];
};

 

going to try and put the scripts in and see if it works..

20170426223759_1.jpg

Link to comment
Share on other sites

  • 0
2 hours ago, Robert261171 said:

Ive tried that and I loose all the menu's of all the traders,

Ive been looking at the old plotManagement script and trying to modify that one..

what do you think?

if u loose the trader option, then youre making something wrong in ffn_selfactions

Spoiler

custom fn_selfaction

find:


if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {

above paste:


//gethum
if ((_cursorTarget isKindOf "WarfareBunkerSign") && {speed player <= 1}) then {
if (s_player_ph < 0) then {
            s_player_ph = player addaction[("<t color=""#F7D708"">" + ("GetPlayersHumanity") +"</t>"),"humanity\phum.sqf"];
        };

    } else {
        player removeAction s_player_ph;
        s_player_ph = -1;
    };

find:


} else {
    //Engineering

below paste:


player removeAction s_player_ph;
        s_player_ph = -1;
Quote

You also need to put s_player_ph = -1; into variables.sqf to initialize it otherwise you will get an undefined error on startup

 

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