Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/26/2019 in all areas

  1. 1 point
    First you navigate to AltisLife.Altis\core\actions and make a file called fn_takeOrgans.sqf and paste this in: /* file: fn_takeOrgans.sqf author: [midgetgrimm] - www.grimmlife.com Updated and improved upon by: Edward - Edward#2003 */ private["_unit"]; _unit = cursorTarget; //Playerchecks if(isNull _unit) exitWith {}; //if unit is null, than NO if((_unit getVariable ["missingOrgan",FALSE])) exitWith {};//must not be missing organ already if((player getVariable ["hasOrgan",FALSE])) exitWith {};//thief must not have already robbed an organ within last 5 mintues if((animationState _unit != "Incapacitated")) exitWith {};//victim must be knocked out if(player == _unit) exitWith {};//if the thief is the cursor target(dafuq) than NO if(!isPlayer _unit) exitWith {};//iff the cursor target is not a player than NO if(life_inv_scalpel < 1) exitWith {hint "You need scalpels!"}; if(life_inv_kidney >= 2) exitWith {hint "You can't possibly need that many organs!"};//if you already have 2 kidneys, then go sell them already, no stockpiling if(!([true,"kidney",1] call life_fnc_handleInv)) exitWith {hint "You don't have room to store any organs!"};//if no room for kidney, you cannot take their kidney, duh, waste not want not life_action_inUse = true;//sets action to true as to prevent kidney spammming!!!!!!!! player setVariable["hasOrgan",true,true];//sets variable on thief, so as not to consistently take organs, set to 5 minute cooldown if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then { [player,"AinvPknlMstpSnonWnonDnon_medic_1"] remoteExecCall ["life_fnc_animSync",RCLIENT]; player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1"; }; uiSleep 3;//length of action, had weird results with any higher - obviously not realistic, but whatever _unit setVariable["missingOrgan",true,true];//sets the missing organ variable so effects can take place life_action_inUse = false;//once variables are set, and actions stop, then you can use scrolly wheely [player] remoteExec ["life_fnc_hasOrgan", _unit];//this then calls the fn_hasOrgan.sqf on the thief [false,"scalpel",1] call life_fnc_handleInv; Second navigate to AltisLife.Altis\core\civilian and make a filled called fn_hasOrgan.sqf and paste this in /* file: fn_hasOrgan.sqf author: [midgetgrimm] - www.grimmlife.com Updated and improved upon by: Edward - Edward#2003 */ private["_organThief"]; _organThief = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; if(isNull _organThief) exitWith {}; //if not the thief get bent [1, format["%1 has cut out a kidney from %2.",name _organThief, name player]] remoteExec ["life_fnc_broadcast", civilian]; [_organThief,"kidney",1] call life_fnc_handleInv;//put stolen kidney into inventory of thief //Add to Wanted list if (life_HC_isActive) then { [getPlayerUID player, player getVariable ["realname",name player],"919"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life]; } else { [getPlayerUID player, player getVariable ["realname",name player],"919"] remoteExecCall ["life_fnc_wantedAdd",RSERV]; }; uiSleep 300;//no more organ theft for at least 5 minutes, so they cant just do it over and over, can do whatever time you want _organThief setVariable["hasOrgan",false,true];//allow them to be able to take organs again- setting a variable Third navigate to AltisLife.Altis\ and open Functions.hpp and add these in the respective areas: Under class Actions { add class takeOrgans {}; And under class Civilian { class hasOrgan {} Fourth navigate to AltisLife.Altis\core and open fn_setupActions.sqf and under case civilian: { add // take them organs life_actions = life_actions + [player addAction["Harvest Organs",life_fnc_takeOrgans,"",0,false,false,"",'!isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget getVariable ["missingOrgan",FALSE]) && !(player getVariable "Escorting") && !(player getVariable "hasOrgan") && !(player getVariable "transporting") && animationState cursorTarget == "Incapacitated"']]; Fifth navigate to AltisLife.Altis\ and open initPlayerLocal.sqf and this code under [] execVM "core\init.sqf"; [] spawn { while{true} do { waitUntil {(player getVariable "missingOrgan")}; life_max_health = .70; while{(player getVariable "missingOrgan")} do { life_thirst = 70; life_hunger = 70; if(damage player < (1 - life_max_health)) then {player setDamage (1 - life_max_health);}; "dynamicBlur" ppEffectEnable true; "dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 1; sleep 5; }; "dynamicBlur" ppEffectEnable false; life_max_health = 1; }; }; Sixth navigate to AltisLife.Altis\core\pmenu and open fn_useItem.sqf where you add this code under switch (true) do case (_item == "kidney"): { if(([false,_item,1] call life_fnc_handleInv)) then { player setVariable["missingOrgan",false,true]; life_thirst = 100; life_hunger = 100; player setFatigue .5; }; }; Seventh navigate to AltisLife.Altis\core and open init.sqf and add and add this below the others player setVariable["missingOrgan",false,true]; player setVariable["hasOrgan",false,true]; Next navigate to AltisLife.Altis\core\medical and open fn_onPlayerKilled.sqf and add this below the others _unit setVariable["missingOrgan",false,true]; _unit setVariable["hasOrgan",false,true]; Next open fn_onPlayerRespawn.sqf and add this below the others _unit setVariable["missingOrgan",false,true]; _unit setVariable["hasOrgan",false,true]; Eighth navigate to AltisLife.Altis\config and open Config_vItems.hpp and add these two to class VirtualItems class kidney { variable = "kidney"; displayName = "STR_Item_Kidney"; weight = 15; buyPrice = 75000; sellPrice = 50000; illegal = true; edible = -1; icon = ""; }; class scalpel { variable = "scalpel"; displayName = "STR_Item_Scalpel"; weight = 5; buyPrice = 10000; sellPrice = 5000; illegal = true; edible = -1; icon = ""; }; Ninth add these two to the stringtable.xml in AltisLife.Altis\ <Key ID="STR_Item_Kidney"> <Original>Kidney</Original> </Key> <Key ID="STR_Item_Scalpel"> <Original>Scalpel</Original> </Key> Tenth add the kidney to any virtual shop, or make your own shop “kidney” Eleventh navigate to AltisLife.Altis\ and open CfgRemoteExec.hpp and under /* Client only functions */ add F(life_fnc_hasOrgan,CLIENT) NOTE: This code is really old, and from the previous altisliferpg.com I just converted it to make it work with 5.0 a while back, I just added a few things to make it more realistic But this script is definitely not up to the coding standards of today
  2. 1 point
    Remove all the statements with '_veh isEqualTo ...' in fn_clearVehicleAmmo and add the following: if (!(_veh in LIFE_SETTINGS(getArray,"vehicleShop_rentalOnly"))) then { private ["_mags", "_i"]; _mags = [_veh magazinesTurret [-1],_veh magazinesTurret [0],_veh magazinesTurret [1]];// need to define for each vehicle type _i= -1; { _veh removeMagazinesTurret [_x select 0,[_i]]; _i = _i + 1; } forEach _mags; }; This will remove ammo of all turrets of all vehicles, except from the rental only vehicles. The reason I want rental only vehicles to have ammo, is because I am allowing my players to rent vehicles with turrets.
  3. 1 point
    I see no reference to that in this script. Are you sure it's even from this?
  4. 1 point
    This has been answered many times around here. No idea the cause, but it does happen from time to time. Reapply the skin often works, so you could add a button to reapply it or just do it on y-menu opening as I showed here:
×
×
  • Create New...