I'm currently working on a body armor script based off right click functions with Ceramic plates. I'm having a bit of an issue getting it to work though cause of the variables for increasing the players blood.
Here is the bit I have in variables.sqf but can't figure out where to put it?
_pb = player getVariable["pb",0];
if (isNil "_pb") then {
_pb = 0;
};
_bloodCap = 12000;
if (_pb== 1) then {
_bloodCap = 13500;
};
r_player_blood = _bloodCap;
r_player_bloodTotal = r_player_blood;
};
The script i have so far: Will be released when I can get it working! :)
// Check if player is in skin with armor plate carrier
while {true} do {
if (_humanity >= 2500) exitWith {
cutText [format["You need 5000 humanity to do that!"], "PLAIN DOWN"];
};
if (_humanity2 <= -2500) exitWith {
cutText [format["You need -5000 humanity to do that!"], "PLAIN DOWN"];
};
// Let's check if they are in a vehicle
if (_inVehicle) exitWith {
cutText [format["You can't put on armor in a vehicle!"], "PLAIN DOWN"];
};
// No players should be around them
if (_countplayers > 1) exitWith {
cutText [format["You are too close to another player!"], "PLAIN DOWN"];
};
// Remove item from the gear
if (call {_hasitems}) then {
player removeMagazine "ItemCeramicParts";
sleep 2;
player playActionNow "PutDown";
};
// Player has armor on - Let others know
P_hasarmor = "Sign_sphere10cm_EP1" createVehicle position player;
P_hasarmor attachto [player,[0, 0.10, 0] "RightHandMiddle1"];
// Let's change blood value and act as armor
_pb = player getVariable["pb",0];
r_player_bloodTotal = 12000;
if (_pb == 1) then {
r_player_bloodTotal = 13500;
};
// Adds nice text
[format["<t size='1.2' color='#960000'size='0.9'>You have put on Body Armor</t>"],0,0,4,1] spawn BIS_fnc_dynamicText;
// Has player died - Then remove marker
if (r_player_bloodTotal = 0) then {
deleteVehicle P_hasarmor;
};
I will give credit for those who want to help out here? Thanks
Question
Reaper5150
I'm currently working on a body armor script based off right click functions with Ceramic plates. I'm having a bit of an issue getting it to work though cause of the variables for increasing the players blood.
Here is the bit I have in variables.sqf but can't figure out where to put it?
_pb = player getVariable["pb",0];
if (isNil "_pb") then {
_pb = 0;
};
_bloodCap = 12000;
if (_pb== 1) then {
_bloodCap = 13500;
};
r_player_blood = _bloodCap;
r_player_bloodTotal = r_player_blood;
};
The script i have so far: Will be released when I can get it working! :)
private ["_humanity","_humanity2","_item","_inVehicle","_countplayers","_hasitems","P_hasarmor"];
_humanity = player getVariable["humanity", 5000];
_humanity2 = player getVariable["humanity", -5000];
_item = ["ItemCeramicParts"];
_hasitems = [_item] call player_checkItems;
_inVehicle = (_vehicle = player);
_countplayers = count nearestObjects [player, ["CAManBase"], 1];
// Check if player is in skin with armor plate carrier
while {true} do {
if (_humanity >= 2500) exitWith {
cutText [format["You need 5000 humanity to do that!"], "PLAIN DOWN"];
};
if (_humanity2 <= -2500) exitWith {
cutText [format["You need -5000 humanity to do that!"], "PLAIN DOWN"];
};
// Let's check if they are in a vehicle
if (_inVehicle) exitWith {
cutText [format["You can't put on armor in a vehicle!"], "PLAIN DOWN"];
};
// No players should be around them
if (_countplayers > 1) exitWith {
cutText [format["You are too close to another player!"], "PLAIN DOWN"];
};
// Remove item from the gear
if (call {_hasitems}) then {
player removeMagazine "ItemCeramicParts";
sleep 2;
player playActionNow "PutDown";
};
// Player has armor on - Let others know
P_hasarmor = "Sign_sphere10cm_EP1" createVehicle position player;
P_hasarmor attachto [player,[0, 0.10, 0] "RightHandMiddle1"];
// Let's change blood value and act as armor
_pb = player getVariable["pb",0];
r_player_bloodTotal = 12000;
if (_pb == 1) then {
r_player_bloodTotal = 13500;
};
// Adds nice text
[format["<t size='1.2' color='#960000'size='0.9'>You have put on Body Armor</t>"],0,0,4,1] spawn BIS_fnc_dynamicText;
// Has player died - Then remove marker
if (r_player_bloodTotal = 0) then {
deleteVehicle P_hasarmor;
};
I will give credit for those who want to help out here? Thanks
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now