Hallo, ich bin dabei ne neue Farmroute zu erstellen nach dem Tutorial von Noldy
Bekomme immer den selben fehler und zwar.
Code
18:18:16 Error in expression <ight) * _num;
_value = missionNamespace getVariable _var;
if(_math) then
{
if(>
18:18:16 Error position: <getVariable _var;
if(_math) then
{
if(>
18:18:16 Error getvariable: Typ Bool, erwartet Array,Zeichenfolge
18:18:16 File mpmissions\__CUR_MP.Tanoa\core\functions\fn_handleInv.sqf, line 22
Alles anzeigen
Sobald ich abbauen will. aber nur bei der neuen Farmroute die anderen funktionieren alle ohne probleme.
Code: fn_pickaxeUse.sqf
/*
File: fn_pickaxeUse.sqf
Author: Bryan "Tonic" Boardwine
player
Description:
Main functionality for pickaxe in mining.
*/
closeDialog 0;
private["_mine","_itemWeight","_diff","_itemName","_val","_time","_data"];
switch (true) do
{
case (player distance (getMarkerPos "lead_1") < 30): {_mine = "copperore"; _val = 2;};
case (player distance (getMarkerPos "iron_1") < 30): {_mine = "iron"; _val = 2;};
case (player distance (getMarkerPos "salt_1") < 120) : {_mine = "salt"; _val = 4;};
case (player distance (getMarkerPos "sand_1") < 75) : {_mine = "sand"; _val = 3;};
case (player distance (getMarkerPos "diamond_1") < 50): {_mine = "diamond"; _val = 1;};
case (player distance (getMarkerPos "oil_1") < 40) : {_mine = "oilu"; _val = 2;};
case (player distance (getMarkerPos "oil_2") < 40) : {_mine = "oilu"; _val = 2;};
case (player distance (getMarkerPos "rock_1") < 50): {_mine = "rock"; _val = 2;};
case (player distance (getMarkerPos "platin") < 50): {_mine = "platin"; _val = 2;};
case (player distance (getMarkerPos "zinn") < 50): {_mine = "zinn"; _val = 2;};
case (player distance (getMarkerPos "titanium") < 50): {_mine = "titanium"; _val = 2;};
case (player distance (getMarkerPos "gold") < 50): {_mine = "gold"; _val = 2;};
case (player distance (getMarkerPos "uran_1") < 15): {_mine = "uranium1"; _val = 1;};
case (player distance (getMarkerPos "silber") < 50): {_mine = "silber"; _val = 2;};
case (player distance (getMarkerPos "koko1") < 50): {_mine = "kokom"; _val = 2;};
default {_mine = "";};
};
//Mine check
if(_mine == "") exitWith {hint localize "STR_ISTR_Pick_NotNear"};
if(vehicle player != player) exitWith {hint localize "STR_ISTR_Pick_MineVeh";};
_diff = [_mine,_val,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if(_diff == 0) exitWith {hint localize "STR_NOTF_InvFull"};
life_action_gather = true;
life_action_inUse = true;
_time = 0;
_profName = [_mine] call life_fnc_profType;
if( _profName != "" ) then
{
_data = missionNamespace getVariable (_profName);
_time = ( 3 - (0.25 * (_data select 0)));
};
for "_i" from 0 to 2 do
{
player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";};
sleep _time;
};
if(([true,_mine,_diff] call life_fnc_handleInv)) then
{
_itemName = [([_mine,0] call life_fnc_varHandle)] call life_fnc_varToStr;
titleText[format[localize "STR_ISTR_Pick_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then
{
[_profName,1] call life_fnc_addExp;
};
};
life_action_inUse = false;
life_action_gather = false;
Alles anzeigen
Code: fn_handleInv.sqf
/*
File: fn_handleInv.sqf
Author: Bryan "Tonic" Boardwine
Description:
Do I really need one?
*/
private["_math","_item","_num","_return","_var","_weight","_value","_diff"];
_math = [_this,0,false,[false]] call BIS_fnc_param; //true = add; false = subtract;
_item = [_this,1,"",[""]] call BIS_fnc_param; //The item we are using to add or remove.
_num = [_this,2,0,[0]] call BIS_fnc_param; //Number of items to add or remove.
if(_item == "" OR _num == 0) exitWith {false};
_var = [_item,0] call life_fnc_varHandle;
if(_math) then
{
_diff = [_item,_num,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
_num = _diff;
if(_num <= 0) exitWith {false};
};
_weight = ([_item] call life_fnc_itemWeight) * _num;
_value = missionNamespace getVariable _var;
if(_math) then
{
//Lets add!
if((life_carryWeight + _weight) <= life_maxWeight) then
{
missionNamespace setVariable[_var,(_value + _num)];
if((missionNamespace getVariable _var) > _value) then
{
life_carryWeight = life_carryWeight + _weight;
_return = true;
}
else
{
_return = false;
};
}
else
{
_return = false;
};
}
else
{
//Lets subtract!
if((_value - _num) < 0) then
{
_return = false;
}
else
{
missionNamespace setVariable[_var,(_value - _num)];
if((missionNamespace getVariable _var) < _value) then
{
life_carryWeight = life_carryWeight - _weight;
_return = true;
}
else
{
_return = false;
};
};
};
_return;
Alles anzeigen
Wie gesagt alles funktionert, ausser das mit Kokosnuss z.b , aber nur sobald ich an der Mine stehe und abbauen will haut er mir oben die fehler Meldung raus und zerschiesst mir die ganzen Scripts, das nichts mehr so wirklich geht.
Hoffe kann mir jemand helfen dabei. Wäre sehr dankbar