Guten tag,
Ich habe folgendes problem:
undzwar ist mir aufgefallen das man weder essen noch trinken verliert und sozusagen nie essen bzw trinken muss.
Ich war über 2 stunden aufm server
fn_survival.sqf
#include "..\script_macros.hpp"
/*
Author: Bryan "Tonic" Boardwine
Description:
All survival? things merged into one thread.
*/
private["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_curPos"];
_fnc_food = {
if(life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
else
{
SUB(life_hunger,10);
[] call life_fnc_hudUpdate;
if(life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
switch(life_hunger) do {
case 30: {hint localize "STR_NOTF_EatMSG_1";};
case 20: {hint localize "STR_NOTF_EatMSG_2";};
case 10: {
hint localize "STR_NOTF_EatMSG_3";
if(EQUAL(LIFE_SETTINGS(getNumber,"enable_fatigue"),1)) then {player setFatigue 1;};
};
};
};
};
_fnc_water = {
if(life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
else
{
SUB(life_thirst,10);
[] call life_fnc_hudUpdate;
if(life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
switch(life_thirst) do {
case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
case 20: {
hint localize "STR_NOTF_DrinkMSG_2";
if(EQUAL(LIFE_SETTINGS(getNumber,"enable_fatigue"),1)) then {player setFatigue 1;};
};
case 10: {
hint localize "STR_NOTF_DrinkMSG_3";
if(EQUAL(LIFE_SETTINGS(getNumber,"enable_fatigue"),1)) then {player setFatigue 1;};
};
};
};
};
[] spawn
{
while {true} do
{
waitUntil {(life_drink > 0)};
while{(life_drink > 0)} do {
if(life_drink > 0.08) then {
"radialBlur" ppEffectEnable true;
"radialBlur" ppEffectAdjust[0.08, 0,0.35,0.37];
"radialblur" ppEffectCommit 3;
sleep 240;
life_drink = life_drink - 0.02;
} else {
"radialBlur" ppEffectEnable true;
"radialBlur" ppEffectAdjust[0.05, 0,0.36,0.38];
"radialBlur" ppEffectCommit 1;
sleep 180;
life_drink = life_drink - 0.02;
};
};
"radialBlur" ppEffectAdjust [0,0,0,0];
"radialblur" ppEffectCommit 5;
"radialblur" ppEffectEnable false;
life_drink = 0;
};
};
//TFAR - Task Force Radio - ChannelCheck:
[] spawnr
{
private["_ChannelName","_ServerName","_isTeamSpeakPluginEnabled"];
sleep 15;
while{true}do
{
_ChannelName = call TFAR_fnc_getTeamSpeakChannelName;
_ServerName = call TFAR_fnc_getTeamSpeakServerName;
_isTeamSpeakPluginEnabled = call TFAR_fnc_isTeamSpeakPluginEnabled;
_DarfNixSehen = false;
_IstAdmin = ((call life_adminlevel) > 0);
_WhiteListedChannels = ["Tanoa Server", "Tom", "╔ Support Schalter 1", "╠ Support Schalter 2", "╠ Support Schalter 3"];
if(!_IstAdmin && _ServerName != "Tanoa Island RPG!" )then{_DarfNixSehen = true;};
if(!_IstAdmin && !(_ChannelName in _WhiteListedChannels) )then{_DarfNixSehen = true;};
if(!_IstAdmin && !_isTeamSpeakPluginEnabled )then{_DarfNixSehen = true;};
if(_DarfNixSehen) then{cutText["Falscher Channel/Server oder TFAR Plugin nicht aktiviert.","BLACK FADED"];}
else{cutText ["","PLAIN"];};
sleep 3;
};
};
//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (SEL(_lastPos,0)) + (SEL(_lastPos,1));
_lastState = vehicle player;
while {true} do {
/* Thirst / Hunger adjustment that is time based */
if((time - _waterTime) > 600) then {[] call _fnc_water; _waterTime = time;};
if((time - _foodTime) > 850) then {[] call _fnc_food; _foodTime = time;};
/* Adjustment of carrying capacity based on backpack changes */
if(EQUAL(backpack player,"")) then {
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
_bp = backpack player;
} else {
if(!(EQUAL(backpack player,"")) && {!(EQUAL(backpack player,_bp))}) then {
_bp = backpack player;
life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,CONFIG_VEHICLES,_bp,"maximumload") / 4);
};
};
/* Check if the player's state changed? */
if(vehicle player != _lastState OR {!alive player}) then {
[] call life_fnc_updateViewDistance;
_lastState = vehicle player;
};
/* Check if the weight has changed and the player is carrying to much */
if(life_carryWeight > life_maxWeight && {!isForcedWalk player}) then {
player forceWalk true;
if(EQUAL(LIFE_SETTINGS(getNumber,"enable_fatigue"),1)) then {player setFatigue 1;};
hint localize "STR_NOTF_MaxWeight";
} else {
if(isForcedWalk player) then {
player forceWalk false;
};
};
/* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
if(!alive player) then {_walkDis = 0;} else {
_curPos = visiblePosition player;
_curPos = (SEL(_curPos,0)) + (SEL(_curPos,1));
if(!(EQUAL(_curPos,_lastPos)) && {(vehicle player == player)}) then {
ADD(_walkDis,1);
if(EQUAL(_walkDis,650)) then {
_walkDis = 0;
SUB(life_thirst,20);
SUB(life_hunger,20);
[] call life_fnc_hudUpdate;
};
};
_lastPos = visiblePosition player;
_lastPos = (SEL(_lastPos,0)) + (SEL(_lastPos,1));
};
if(player getVariable "ACE_isUnconscious" && !life_unconscious) then {
_action = [
format["Du bist Ohnmächtig. Mit letzter kraft kannst du dein Handy ziehen. Möchtest du einen Notarzt über deine Lage informieren? Wenn nicht hast du noch ca 10 Minuten zu leben."],
"Ohnmächtig",
localize "STR_Global_Yes",
localize "STR_Global_No"
] call BIS_fnc_guiMessage;
life_corpse = player;
if(!isNil "_action" && {_action}) then {
[] call life_fnc_requestMedic;
_medicsOnline = {_x != player && {side _x == independent} && {alive _x}} count playableUnits > 0;
if(!_medicsOnline) then {
_action = [
format["Kein Notarzt hat auf deine Nachricht geantwortet. Wenn ein Spieler dich findet kann er dich in einn Krankenhaus bringen und dort von einem Artzt (NPC) behandeln lassen."],
"Niemand da",
"Ok"
] call BIS_fnc_guiMessage;
};
};
life_unconscious = true;
};
if(!(player getVariable "ACE_isUnconscious") && life_unconscious) then {
life_unconscious = false;
};
uiSleep 1;
};