Jump to content
  • 0

Need Help with 4 Scripts


Kimarik

Question

Hello. I'm looking for someone to help me rewrite 4 scripts to Epoch 1.0.6.1 because I don´t know about the new Variables.

Here are the scripts I need.

Script is from Deploy Bike, but i need one for ATV with Toolbox, Engine and Wheel and one for Mozzie with Toolbox, Engine and Mainrotor

Spoiler

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools"];
_inventory = items player;
_hastools = "ItemToolbox" in _inventory;

if (!_hastools) exitWith {cutText [format["Toolbox Needed."], "PLAIN DOWN"];};

///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your bike while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";

_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "Old_bike_TK_INS_EP1" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a bike out of your toolbox."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["WARNING: This bike won't be saved during server restart!"], "PLAIN DOWN"];
};

buy + Humanity

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

buy - Humanity

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

In the humanity scripts the coin deduction from the player works, but you get no humanity credited or deducted.
Hope someone can help me.

Sry for the bad English i use Google Tranlator

 

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0
5 hours ago, Kimarik said:

Hello. I'm looking for someone to help me rewrite 4 scripts to Epoch 1.0.6.1 because I don´t know about the new Variables.

Here are the scripts I need.

Script is from Deploy Bike, but i need one for ATV with Toolbox, Engine and Wheel and one for Mozzie with Toolbox, Engine and Mainrotor

  Reveal hidden contents

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools"];
_inventory = items player;
_hastools = "ItemToolbox" in _inventory;

if (!_hastools) exitWith {cutText [format["Toolbox Needed."], "PLAIN DOWN"];};

///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your bike while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";

_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "Old_bike_TK_INS_EP1" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a bike out of your toolbox."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["WARNING: This bike won't be saved during server restart!"], "PLAIN DOWN"];
};

buy + Humanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

buy - Humanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

In the humanity scripts the coin deduction from the player works, but you get no humanity credited or deducted.
Hope someone can help me.

Sry for the bad English i use Google Tranlator

 

 

 

Link to comment
Share on other sites

  • 0

@Kimarik

atv

Spoiler

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools","_hasitem","_removed"];
_inventory = items player;
_hastools = "ItemToolbox" in _inventory;
_hasitem = [["PartWheel",4], "PartEngine","PartFueltank"] call player_checkItems;
if (!_hastools) exitWith {cutText [format["Toolbox Needed."], "PLAIN DOWN"];};
if (!_hasitem) exitWith {cutText [format["4xwhells 1xEngine 1xFuelTank Needed."], "PLAIN DOWN"];};
///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your atv while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";

_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "ATV_CZ_EP1" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a atv out of your toolbox."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;
_removed = [["PartWheel",4], "PartEngine","PartFueltank"] call player_removeItems; 
cutText [format["WARNING: This atv won't be saved during server restart!"], "PLAIN DOWN"];
};

 

change the item and the id for made the mozzie script.

Mozzie and gyro ids

CSJ_GyroC

CSJ_GyroCover

CSJ_GyroP

 

PartVRotor  PartEngine

Link to comment
Share on other sites

  • 0
Spoiler

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools"];
_inventory = items player;
_hastools = ["ItemToolbox","PartEngine","PartGeneric","PartWheel"] in _inventory;  // This is the line checking for the toolbox, or any item you need for the spawn.

if (!_hastools) exitWith {cutText [format["You're Missing Items to deploy your ATV."], "PLAIN DOWN"];};

///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your ATV while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deployatv2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox"; // These lines removes the items required to build the vehicle. Notice removeWEAPON and removeMAGAZINE
player removeMagazine "PartEngine";
player removeMagazine "PartGeneric";
player removeMagazine "PartWheel";


_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "ATV_US_EP1" createVehicle (position player); // This is the line that decides what you want to spawn.
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a ATV out of your Items."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["WARNING: This bike won't be saved during server restart!"], "PLAIN DOWN"];
};

compare this one to yours, using a software called Beyond compare. Right click on one, compare, right click n the other, and compare... it will highlight both differences in each file.

it will help you do more.

You also need a pack script....that one can be modified in a very similar way than this one.  You give back the items once packed. IF you dont have any packing scripts let me know...

You will also need to add any new vehicle you allow players to spawn in the DayZ_SafeObjects in variables.sqf

So open variables.sqf and look for DayZ_SafeObjects. In that array, at the end add your new vehicle, in this case the atv...

buyhumanity

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

remove humanity

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

I havnt tested anything, but it should work

Link to comment
Share on other sites

  • 0
1 hour ago, theduke said:
  Reveal hidden contents

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools"];
_inventory = items player;
_hastools = ["ItemToolbox","PartEngine","PartGeneric","PartWheel"] in _inventory;  // This is the line checking for the toolbox, or any item you need for the spawn.

if (!_hastools) exitWith {cutText [format["You're Missing Items to deploy your ATV."], "PLAIN DOWN"];};

///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your ATV while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deployatv2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox"; // These lines removes the items required to build the vehicle. Notice removeWEAPON and removeMAGAZINE
player removeMagazine "PartEngine";
player removeMagazine "PartGeneric";
player removeMagazine "PartWheel";


_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "ATV_US_EP1" createVehicle (position player); // This is the line that decides what you want to spawn.
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a ATV out of your Items."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["WARNING: This bike won't be saved during server restart!"], "PLAIN DOWN"];
};

compare this one to yours, using a software called Beyond compare. Right click on one, compare, right click n the other, and compare... it will highlight both differences in each file.

it will help you do more.

You also need a pack script....that one can be modified in a very similar way than this one.  You give back the items once packed. IF you dont have any packing scripts let me know...

You will also need to add any new vehicle you allow players to spawn in the DayZ_SafeObjects in variables.sqf

So open variables.sqf and look for DayZ_SafeObjects. In that array, at the end add your new vehicle, in this case the atv...

buyhumanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

remove humanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

I havnt tested anything, but it should work

Where would this be added? i would love to test this feature out  for the humanity gain/loos buying

Link to comment
Share on other sites

  • 0

@Kimarik about humanity,, you also can sell a specific value for humanity.. for example Set my humanity in -10.000

so the script looks:

private ["_cost","_wealth"];

_cost = 1000000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText [format["Humanity Change by -10000"] , "PLAIN DOWN", 1]; 
sleep 0.1;
player setVariable["humanity",-10000,true];

 

Link to comment
Share on other sites

  • 0
On 4/23/2017 at 10:36 AM, theduke said:
  Reveal hidden contents

//SimpleDeployBike
//By Relentless

///////////////////////////////REMOVE BELOW IF URE USING EXTRA_RC.hpp///////////////////////
private ["_inventory","_hastools"];
_inventory = items player;
_hastools = ["ItemToolbox","PartEngine","PartGeneric","PartWheel"] in _inventory;  // This is the line checking for the toolbox, or any item you need for the spawn.

if (!_hastools) exitWith {cutText [format["You're Missing Items to deploy your ATV."], "PLAIN DOWN"];};

///////////////////////////////REMOVE ABOVE IF URE USING EXTRA_RC.hpp///////////////////////

if (false) then {
cutText [format["You can't place your ATV while you're in combat."], "PLAIN DOWN"];
} else {
player removeAction s_player_deployatv2;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox"; // These lines removes the items required to build the vehicle. Notice removeWEAPON and removeMAGAZINE
player removeMagazine "PartEngine";
player removeMagazine "PartGeneric";
player removeMagazine "PartWheel";


_dis = 10;
_sfx = "repair";

[player, _sfx, 0, false, _dis] call dayz_zombieSpeak;
[player, _dis, true, (getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "ATV_US_EP1" createVehicle (position player); // This is the line that decides what you want to spawn.
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;
cutText [format["You constructed a ATV out of your Items."], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["WARNING: This bike won't be saved during server restart!"], "PLAIN DOWN"];
};

compare this one to yours, using a software called Beyond compare. Right click on one, compare, right click n the other, and compare... it will highlight both differences in each file.

it will help you do more.

You also need a pack script....that one can be modified in a very similar way than this one.  You give back the items once packed. IF you dont have any packing scripts let me know...

You will also need to add any new vehicle you allow players to spawn in the DayZ_SafeObjects in variables.sqf

So open variables.sqf and look for DayZ_SafeObjects. In that array, at the end add your new vehicle, in this case the atv...

buyhumanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

remove humanity

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

I havnt tested anything, but it should work

hmm, is there a way of doing this at a trader? similar to how players trader bio meat?  Or something where i dont have to use the custom gui

Link to comment
Share on other sites

  • 0
1 hour ago, DieTanx said:

hmm, is there a way of doing this at a trader? similar to how players trader bio meat?  Or something where i dont have to use the custom gui

custom fn_selfaction

find:

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

above paste:

//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
            s_player_ht = player addaction[("<t color=""#F7D708"">" + ("Humanity bandit") +"</t>"),"humanitytrader\hbtrader.sqf"];
        };
if (s_player_hth < 0) then {
            s_player_hth = player addaction[("<t color=""#F7D708"">" + ("Humanity hero") +"</t>"),"humanitytrader\hhtrader.sqf"];
        };
    } else {
        player removeAction s_player_ht;
        s_player_ht = -1;
		 player removeAction s_player_hth;
        s_player_hth = -1;
	};

find:

} else {
    //Engineering

below paste:

player removeAction s_player_ht;
        s_player_ht = -1;

player removeAction s_player_hth;
        s_player_hth = -1;

 

now drop and rename the humanity files by

hhtrader.sqf

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

hbtrader.sqf

Spoiler

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

the folder for this two must be mpmissions\your instance\humanitytrader\

the // Weapons neutral trader gonna take the humanity script.  change the id to give the option to another trader.

//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {

Link to comment
Share on other sites

  • 0
On 23.4.2017 at 11:11 AM, Kimarik said:

 i need one for ATV with Toolbox, Engine and Wheel

Just about realistic ....... a ATV has 4 (in words: four) wheels AND a FUELTANK. I dont know why allways make things fucking easy ......... reciept ATV: 1 engine, 4 wheels and 1 fuel tank.

On my server you can deploy a BTR40 (not armed) from: 1 engine, 1 fuel tank, 4 wheels, 3 tank traps and 3 metal plates.

Or a yellow pook (bell 47) from: 1 rotor, 2 engines, 2 fuel tanks, 2 metal scrap and 2 glass.

 

Link to comment
Share on other sites

  • 0
3 hours ago, Anhor said:

Just about realistic ....... a ATV has 4 (in words: four) wheels AND a FUELTANK. I dont know why allways make things fucking easy ......... reciept ATV: 1 engine, 4 wheels and 1 fuel tank.

On my server you can deploy a BTR40 (not armed) from: 1 engine, 1 fuel tank, 4 wheels, 3 tank traps and 3 metal plates.

Or a yellow pook (bell 47) from: 1 rotor, 2 engines, 2 fuel tanks, 2 metal scrap and 2 glass.

 

atv required items

_hasitem = [["PartWheel",4], "PartEngine","PartFueltank"] call player_checkItems;
_removed = [["PartWheel",4], "PartEngine","PartFueltank"] call player_removeItems; 

 

Link to comment
Share on other sites

  • 0

Hi i testet the humanity script. it take my money but i don´t get any humanity

Maybe this could help for make it working. It´s form Infistar Admintool.

Spoiler


    adminHumanityPlus =
    {
        {
            if(name _x == _this select 0)then
            {
                _humanity = _x getVariable['humanity',0];
                _x setVariable['humanity',_humanity+2500,true];
                hint format['Gave %1 +2500 Humanity!',_this select 0];
                
                _sl = format['%1 plus 2500 Humanity to %2',name player,_this select 0];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminHumanityMinus =
    {
        {
            if(name _x == _this select 0)then
            {
                _humanity = _x getVariable['humanity',0];
                _x setVariable['humanity',_humanity-2500,true];
                hint format['Gave %1 -2500 Humanity!',_this select 0];
                
                _sl = format['%1 minus 2500 Humanity to %2',name player,_this select 0];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };

 

Link to comment
Share on other sites

  • 0
2 hours ago, Kimarik said:

Hi i testet the humanity script. it take my money but i don´t get any humanity

Maybe this could help for make it working. It´s form Infistar Admintool.

  Hide contents


    adminHumanityPlus =
    {
        {
            if(name _x == _this select 0)then
            {
                _humanity = _x getVariable['humanity',0];
                _x setVariable['humanity',_humanity+2500,true];
                hint format['Gave %1 +2500 Humanity!',_this select 0];
                
                _sl = format['%1 plus 2500 Humanity to %2',name player,_this select 0];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminHumanityMinus =
    {
        {
            if(name _x == _this select 0)then
            {
                _humanity = _x getVariable['humanity',0];
                _x setVariable['humanity',_humanity-2500,true];
                hint format['Gave %1 -2500 Humanity!',_this select 0];
                
                _sl = format['%1 minus 2500 Humanity to %2',name player,_this select 0];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };

 

 _humanity = player getVariable['humanity',0];
 player setVariable['humanity',_humanity+2500,true]; 

 

 

private ["_cost","_wealth","_humanity"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_humanity = player getVariable['humanity',0];
player setVariable['humanity',_humanity+2500,true]; 

 

Link to comment
Share on other sites

  • 0
On 4/24/2017 at 7:03 PM, juandayz said:

custom fn_selfaction

find:


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

above paste:


//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
            s_player_ht = player addaction[("<t color=""#F7D708"">" + ("Humanity bandit") +"</t>"),"humanitytrader\hbtrader.sqf"];
        };
if (s_player_hth < 0) then {
            s_player_hth = player addaction[("<t color=""#F7D708"">" + ("Humanity hero") +"</t>"),"humanitytrader\hhtrader.sqf"];
        };
    } else {
        player removeAction s_player_ht;
        s_player_ht = -1;
		 player removeAction s_player_hth;
        s_player_hth = -1;
	};

find:


} else {
    //Engineering

below paste:


player removeAction s_player_ht;
        s_player_ht = -1;

player removeAction s_player_hth;
        s_player_hth = -1;

 

now drop and rename the humanity files by

hhtrader.sqf

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,+500];
_id = _humanity spawn player_humanityChange;

hbtrader.sqf

  Reveal hidden contents

private ["_cost","_wealth"];

_cost = 100000;
_wealth = player getVariable[Z_moneyVariable,0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable[Z_moneyVariable,(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_humanity = [player,-500];
_id = _humanity spawn player_humanityChange;

the folder for this two must be mpmissions\your instance\humanitytrader\

the // Weapons neutral trader gonna take the humanity script.  change the id to give the option to another trader.

//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {

Getting this error when launching, I also get the results of coins removed, but humanity is unaffected

Spoiler

Error in expression <yer)] spawn player_alertZombies;

_id = _humanity spawn player_humanityChange;

>
  Error position: <_humanity spawn player_humanityChange;

>
  Error Undefined variable in expression: _humanity
File mpmissions\__CUR_MP.Chernarus\humanitytrader\hbtrader.sqf, line 11
Error in expression <yer)] spawn player_alertZombies;

_id = _humanity spawn player_humanityChange;

>
  Error position: <_humanity spawn player_humanityChange;

>
  Error Undefined variable in expression: _humanity
File mpmissions\__CUR_MP.Chernarus\humanitytrader\hhtrader.sqf, line 10

Spoiler

Error in expression <-1;
};
};
} else {

player removeAction s_player_ht;
s_player_ht = -1;

player r>
  Error position: <s_player_ht;
s_player_ht = -1;

player r>
  Error Undefined variable in expression: s_player_ht
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 1176

 

 

Link to comment
Share on other sites

  • 0

@DieTanx use it in fn_selfactions


//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
            s_player_ht = player addaction[("<t color=""#F7D708"">" + ("Humanity bandit") +"</t>"),"humanitytrader\hbtrader.sqf"];
        };
if (s_player_hth < 0) then {
            s_player_hth = player addaction[("<t color=""#F7D708"">" + ("Humanity hero") +"</t>"),"humanitytrader\hhtrader.sqf"];
        };
    } else {
        player removeAction s_player_ht;
        s_player_ht = -1;
		 player removeAction s_player_hth;
        s_player_hth = -1;
	};

hhtrader.sqf

Spoiler

private ["_cost","_wealth","_humanity"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_humanity = player getVariable['humanity',0];
player setVariable['humanity',_humanity+500,true]; 

 

hbtrader.sqf

Spoiler

private ["_cost","_wealth","_humanity"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_humanity = player getVariable['humanity',0];
player setVariable['humanity',_humanity-500,true]; 

 

 

Link to comment
Share on other sites

  • 0
9 hours ago, juandayz said:

@DieTanx use it in fn_selfactions



//pay hum
if ((_cursorTarget isKindOf "CIV_EuroMan01_EP1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
            s_player_ht = player addaction[("<t color=""#F7D708"">" + ("Humanity bandit") +"</t>"),"humanitytrader\hbtrader.sqf"];
        };
if (s_player_hth < 0) then {
            s_player_hth = player addaction[("<t color=""#F7D708"">" + ("Humanity hero") +"</t>"),"humanitytrader\hhtrader.sqf"];
        };
    } else {
        player removeAction s_player_ht;
        s_player_ht = -1;
		 player removeAction s_player_hth;
        s_player_hth = -1;
	};

hhtrader.sqf

  Reveal hidden contents


private ["_cost","_wealth","_humanity"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_humanity = player getVariable['humanity',0];
player setVariable['humanity',_humanity+500,true]; 

 

hbtrader.sqf

  Reveal hidden contents


private ["_cost","_wealth","_humanity"];

_cost = 100000;
_wealth = player getVariable["cashMoney",0];
if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to change your Humanity",_cost], "PLAIN DOWN"]; };
player setVariable["cashMoney",(_wealth - _cost),true];
titleText ["your humanity has been changed","PLAIN DOWN"]; titleFadeOut 5;
sleep 0.1;
_humanity = player getVariable['humanity',0];
player setVariable['humanity',_humanity-500,true]; 

 

 

Get this now when looking at the trader

 

Error in expression <P1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
s_player_ht = pl>
  Error position: <s_player_ht < 0) then {
s_player_ht = pl>
  Error Undefined variable in expression: s_player_ht
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 621

 

 

 

Link to comment
Share on other sites

  • 0
20 minutes ago, DieTanx said:

Get this now when looking at the trader

 

Error in expression <P1") && {speed player <= 1}) then {
if (s_player_ht < 0) then {
s_player_ht = pl>
  Error position: <s_player_ht < 0) then {
s_player_ht = pl>
  Error Undefined variable in expression: s_player_ht
File mpmissions\__CUR_MP.Chernarus\dayz_code\compile\fn_selfActions.sqf, line 621

 

 

 

@DieTanxIf you have a custom variables.sqf (i.e if you're using ZSC or similar)  you will need to add that variable (s_player_ht) into this codeblock: https://github.com/oiad/ZSC/blob/master/dayz_code/init/variables.sqf#L12-L105

i.e: 

s_player_ht = -1;

 

Link to comment
Share on other sites

  • 0
12 hours ago, salival said:

@DieTanxIf you have a custom variables.sqf (i.e if you're using ZSC or similar)  you will need to add that variable (s_player_ht) into this codeblock: https://github.com/oiad/ZSC/blob/master/dayz_code/init/variables.sqf#L12-L105

i.e: 


s_player_ht = -1;

 

     s_player_ht = -1;
     s_player_hth = -1;

After adding these 2 to Variables, this now works! YAY!

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

×
×
  • Create New...