DAKA Posted July 27, 2017 Report Share Posted July 27, 2017 So I have seen this option on other servers were if you dont have enough humanity, you are not allowed to get into certain vehicles. Trying to find out how to do this Link to comment Share on other sites More sharing options...
1 salival Posted September 21, 2017 Report Share Posted September 21, 2017 2 hours ago, totis said: _menClose = cursorTarget; _hasPatient = alive _menClose; _vehicle = vehicle player; _inVehicle = (_vehicle != player); _isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2)); if (_inVehicle) then { r_player_lastVehicle = _vehicle; _assignedRole = assignedVehicleRole player; _driver = driver (vehicle player); if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then { DZE_heroHumanity = ["Mi17_rockets_RU","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BRDM2_CDF","Offroad_SPG9_TERROR","BTR40_MG_TK_INS_EP1","M1126_ICV_M2_EP1","M113_TK_EP1"]; DZE_superHeroHumanity = ["Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W"]; DZE_agentHumanity = ["AV8B2","AV8B","A10","F35B","L39_TK_EP1","BAF_Apache_AH1_D","AH1Z_DZ","SU39","SU34","Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W","M1126_ICV_mK19_EP1","M2A2_EP1","M2A3_EP1","M2A3_EP1","BTR90_DZ","M1A1","M1A2_TUSK_MG","Ural_ZU23_GUE","AAV","T90","ZSU_TK_EP1","T55_TK_EP1","MLRS_DES_EP1"]; _humanity = _driver getVariable["humanity",0]; if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000) then { if (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) then { if (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000) then { player action ["getOut", (vehicle player)]; (format ["Your humanity, %1, is less than the required humanity to use this vehicle", _humanity]) call dayz_rollingMessages; }; }; }; }; }; Can someone points my mistake here. cant make it work. You can't use cascading if's like that. I've cleaned up your script and tested it, this works fine: _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (_inVehicle) then { _driver = driver (vehicle player); if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then { DZE_heroHumanity = ["Mi17_rockets_RU","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BRDM2_CDF","Offroad_SPG9_TERROR","BTR40_MG_TK_INS_EP1","M1126_ICV_M2_EP1","M113_TK_EP1"]; DZE_superHeroHumanity = ["Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W"]; DZE_agentHumanity = ["AV8B2","AV8B","A10","F35B","L39_TK_EP1","BAF_Apache_AH1_D","AH1Z_DZ","SU39","SU34","Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W","M1126_ICV_mK19_EP1","M2A2_EP1","M2A3_EP1","M2A3_EP1","BTR90_DZ","M1A1","M1A2_TUSK_MG","Ural_ZU23_GUE","AAV","T90","ZSU_TK_EP1","T55_TK_EP1","MLRS_DES_EP1","UH1H_DZE"]; _humanity = _driver getVariable["humanity",0]; if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000 || (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) || (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000)) then { player action ["getOut", (vehicle player)]; format ["Your humanity, %1, is less than the required humanity to use this vehicle", _humanity] call dayz_rollingMessages; }; }; }; Link to comment Share on other sites More sharing options...
0 Hooty Posted July 27, 2017 Report Share Posted July 27, 2017 Wrong section nova 1 Link to comment Share on other sites More sharing options...
0 DAKA Posted July 27, 2017 Author Report Share Posted July 27, 2017 What section should this be in? Hooty and nova 2 Link to comment Share on other sites More sharing options...
0 nova Posted July 27, 2017 Report Share Posted July 27, 2017 general discussion is what you are looking for. this is the mods area for telling people how to install mods Hooty 1 Link to comment Share on other sites More sharing options...
0 DAKA Posted July 27, 2017 Author Report Share Posted July 27, 2017 well wouldn't that be considered installing a mod. you have to modify the files to make it work. So I would think it is still in the right place, but I will also post in the section as well. Link to comment Share on other sites More sharing options...
0 Hooty Posted July 27, 2017 Report Share Posted July 27, 2017 Your asking a question, so it would belong in the Q&A. "Questions&Answers" This is Epoch mods ready to go and be installed nova 1 Link to comment Share on other sites More sharing options...
0 nova Posted July 27, 2017 Report Share Posted July 27, 2017 in the area you posted this, people post here to tell people about mods to install and instructions and all that. for example this is appropriate post for this area. the area you are looking for is either https://epochmod.com/forum/forum/96-qa-section/ and or https://epochmod.com/forum/forum/4-general-discussion/ Hooty 1 Link to comment Share on other sites More sharing options...
0 salival Posted July 28, 2017 Report Share Posted July 28, 2017 I've moved the topic to where it maybe should be. There's a few ways you could do this, we check in fn_selfActions.sqf to see if the player is in a vehicle, it would be easy to manipulate this check and add a check against their humanity for the vehicle type they are in. Link to comment Share on other sites More sharing options...
0 totis Posted September 20, 2017 Report Share Posted September 20, 2017 Im interested in this too. can someone write an example? Link to comment Share on other sites More sharing options...
0 juandayz Posted September 20, 2017 Report Share Posted September 20, 2017 Just now, totis said: Im interested in this too. can someone write an example? Quick idea where start to build. _humanity = player getVariable["humanity", 0]; _isBandit = (_humanity <= -2500); _isHero = (_humanity >=5000); _vehicle = vehicle player; _inVehicle = (_vehicle != player); _BanditVeh = typeOf _vehicle in ["hilux1_civil_3_open_DZE","datsun1_civil_3_open_DZE"]; _HeroVeh = typeOf _vehicle in ["V3S_Open_TK_CIV_EP1","V3S_Open_TK_EP1","KamazOpen_DZE"]; if (_inVehicle && _HeroVeh && _isBandit (driver _vehicle == player)) exitWith { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }; if (_inVehicle && _BanditVeh && _isHero (driver _vehicle == player)) exitWith { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }; Link to comment Share on other sites More sharing options...
0 totis Posted September 20, 2017 Report Share Posted September 20, 2017 Perfect Juan. 1000 tnx. Link to comment Share on other sites More sharing options...
0 totis Posted September 20, 2017 Report Share Posted September 20, 2017 Btw the if statement doesnt need an else statement too? Link to comment Share on other sites More sharing options...
0 Relentless Posted September 20, 2017 Report Share Posted September 20, 2017 4 minutes ago, totis said: Btw the if statement doesnt need an else statement too? An else statement is always optional. Link to comment Share on other sites More sharing options...
0 totis Posted September 20, 2017 Report Share Posted September 20, 2017 (edited) ahh ok. Then i must be doing something wrong.... again! lol I have like this under 'custom below' _inVehicle = (_vehicle != player); _HeroVeh = typeOf _vehicle in ["HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","LAV25","M113_TK_EP1","Mi17_rockets_RU","Mi24_D","UH1Y","AH6J_EP1_DZE","Mi171sh_rockets_CZ_EP1","Ka60_PMC","Mi24_V","Mi24_P","Ka52","BRDM2_CDF"]; _humanity = player getVariable["humanity", 0]; _isBandit = (_humanity <= 19999); _isHero = (_humanity >=20000); _isSuperHero = (_humanity >=40000); _isAgentHero = (_humanity >=60000); _vehicle = vehicle player; if (_inVehicle && _HeroVeh && _isBandit (driver _vehicle == player)) exitWith { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }; and doesnt work Ok i see the error at the numbers now. or not! Edited September 20, 2017 by totis double stupid me Link to comment Share on other sites More sharing options...
0 juandayz Posted September 20, 2017 Report Share Posted September 20, 2017 @totis in the way that I propose you.. would you have to use a loop but remember its just a dirt idea . hum_veh.sqf Spoiler _vehicle = vehicle player; waituntil {uiSleep 0.5;(driver _vehicle == player)}; while {(driver _vehicle == player)} do { _vehicle = vehicle player; _humanity = player getVariable["humanity", 0]; _isBandit = (_humanity <= -2500); _isHero = (_humanity >=5000); _inVehicle = (_vehicle != player); _BanditVeh = typeOf _vehicle in ["hilux1_civil_3_open_DZE","datsun1_civil_3_open_DZE"]; _HeroVeh = typeOf _vehicle in ["V3S_Open_TK_CIV_EP1","V3S_Open_TK_EP1","KamazOpen_DZE"]; if (_inVehicle && _HeroVeh && _isBandit && (driver _vehicle == player)) then { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }else{ if (_inVehicle && _BanditVeh && _isHero && (driver _vehicle == player)) then { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }else{ if ((driver _vehicle == player)&& _inVehicle && !_isBandit && !_isHero && _BanditVeh or _HeroVeh ) then { systemchat "<Prevention>:vehicle not allowed for your humanity amount!"; player action['getOut', _vehicle]; }; }; }; waituntil {uiSleep 0.5;(driver _vehicle == player)}; }; now in init.sqf paste: [] execVM 'humveh\hum_veh.sqf'; below of: execFSM "\z\addons\dayz_code\system\player_monitor.fsm"; Link to comment Share on other sites More sharing options...
0 juandayz Posted September 20, 2017 Report Share Posted September 20, 2017 probably will not work at first time,, gonna need some test, for example im not sure if you need recognize the vehicle with cursortarget select3 before say : player action['getOut', _vehicle]; example: _vehicle = cursorTarget; or if all syntax about checks gonna work with this way. Link to comment Share on other sites More sharing options...
0 totis Posted September 20, 2017 Report Share Posted September 20, 2017 Looks like dirt is too much Juan, server is stuck hehe Ill have a look again tomorrow when my eyes are fresher :) Link to comment Share on other sites More sharing options...
0 totis Posted September 21, 2017 Report Share Posted September 21, 2017 Still no luck with this. Im starting to see the logic on the code but doesnt work.. Second way, the dirt way, with sqf server doesnt boot at all. With self actions starts but does nothing Link to comment Share on other sites More sharing options...
0 totis Posted September 21, 2017 Report Share Posted September 21, 2017 _menClose = cursorTarget; _hasPatient = alive _menClose; _vehicle = vehicle player; _inVehicle = (_vehicle != player); _isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2)); if (_inVehicle) then { r_player_lastVehicle = _vehicle; _assignedRole = assignedVehicleRole player; _driver = driver (vehicle player); if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then { DZE_heroHumanity = ["Mi17_rockets_RU","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BRDM2_CDF","Offroad_SPG9_TERROR","BTR40_MG_TK_INS_EP1","M1126_ICV_M2_EP1","M113_TK_EP1"]; DZE_superHeroHumanity = ["Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W"]; DZE_agentHumanity = ["AV8B2","AV8B","A10","F35B","L39_TK_EP1","BAF_Apache_AH1_D","AH1Z_DZ","SU39","SU34","Mi17_rockets_RU","Mi24_V","Mi24_P","Mi24_D","UH1Y_DZE","UH1Y","AH6J_EP1_DZE","CH_47F_BAF","ka137_mg_pmc","pook_H13_gunship_PMC","Mi171sh_rockets_CZ_EP1","Ka60_PMC","AW159_lynx_baf","Ka52Black","Ka52","HMMWV_mK19","HMMWV_TOW","HMMWV_Avenger","HMMWV_M998_Crows_M2_DES_EP1","ArmoredSUV_PMC_DZE4","BAF_JACKAL2_L2A1_W","BMP2_CDF","BMP3","BRDM2_CDF","Offroad_SPG9_TERROR","T72_INS","BTR40_MG_TK_INS_EP1","BTR60_TK_EP1","M1126_ICV_M2_EP1","M113_TK_EP1","T55_TK_EP1","BAF_FV510_W","M1126_ICV_mK19_EP1","M2A2_EP1","M2A3_EP1","M2A3_EP1","BTR90_DZ","M1A1","M1A2_TUSK_MG","Ural_ZU23_GUE","AAV","T90","ZSU_TK_EP1","T55_TK_EP1","MLRS_DES_EP1"]; _humanity = _driver getVariable["humanity",0]; if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000) then { if (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) then { if (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000) then { player action ["getOut", (vehicle player)]; (format ["Your humanity, %1, is less than the required humanity to use this vehicle", _humanity]) call dayz_rollingMessages; }; }; }; }; }; Can someone points my mistake here. cant make it work. Link to comment Share on other sites More sharing options...
0 totis Posted September 21, 2017 Report Share Posted September 21, 2017 Still doesnt work sal. Where i put the code? at the start? at the end? Do i need to add anything at the '_private' line of code? Code starts like this: scriptName "Functions\misc\fn_damageActions.sqf"; #include "\z\addons\dayz_code\util\array.hpp"; /*********************************************************** ADD ACTIONS FOR A CASUALTY - Function - [] call fnc_usec_damageActions; ************************************************************/ private ["_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasEmptyBag","_hasTester","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"]; _vehicle = vehicle player; _inVehicle = (_vehicle != player); Link to comment Share on other sites More sharing options...
0 salival Posted September 21, 2017 Report Share Posted September 21, 2017 2 hours ago, totis said: Still doesnt work sal. Where i put the code? at the start? at the end? Do i need to add anything at the '_private' line of code? Code starts like this: scriptName "Functions\misc\fn_damageActions.sqf"; #include "\z\addons\dayz_code\util\array.hpp"; /*********************************************************** ADD ACTIONS FOR A CASUALTY - Function - [] call fnc_usec_damageActions; ************************************************************/ private ["_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasEmptyBag","_hasTester","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"]; _vehicle = vehicle player; _inVehicle = (_vehicle != player); I didn't test it in an external script, I tested it in a way that means it works, i.e through the test kit. It was just a quick fix of your code before I went to work. Link to comment Share on other sites More sharing options...
0 totis Posted September 21, 2017 Report Share Posted September 21, 2017 Ok Sal i just said that it didnt work for me, But i may installed it wrong hence the above asking if i put it in the correct spot. Tnx for the help Link to comment Share on other sites More sharing options...
0 juandayz Posted September 22, 2017 Report Share Posted September 22, 2017 @totis @DAKA or @someoneelse can you test it... if works i guess its gonna be a lil more better for your server performance using waituntil command at top of the loop. veh_hum.sqf private ["_vehicle","_driver","_humanity","_txt"]; while {true} do { waitUntil {uiSleep 0.25;vehicle player != player}; _vehicle = vehicle player; _driver = driver (vehicle player); if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then { _humanity = _driver getVariable["humanity",0]; if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000 || (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) || (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000)) then { player action ["getOut", (vehicle player)]; titleText ["","WHITE IN"]; _txt = "<img image='addons\vehicon.paa' /><br/><t size='0.7' color='#ea2828' align='center'>prohibited vehicle</t>"; [_txt, [safezoneX, safezoneW], [0.20 * safezoneH + safezoneY, 0.3 * safezoneH], 2, 0.5] spawn BIS_fnc_dynamicText; }; }; sleep 3; }; Link to comment Share on other sites More sharing options...
Question
DAKA
So I have seen this option on other servers were if you dont have enough humanity, you are not allowed to get into certain vehicles. Trying to find out how to do this
Link to comment
Share on other sites
23 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now