Moin,
da mich Scriptfehler beim spielen nerven habe ich mir heute mal die QuestionDealer angeschaut, da ab und mal dort ein Scriptfehler auftaucht und ich wissen wollte weshalb. Nachdem ich mir das zu Gemüte geführt habe entsteht der Fehler durch folgenden Vorgang.
1. Ein Zivilist verkauft seine Drogen beim Dealer
2. Er verlässt die Insel (disconnected)
3. Ein Cop fragt den Dealer ab.
In dem Moment kommt es zu mindestens bei uns zu einem Scriptfehler. Daher hier mal der Fix für das Problemchen. Habe es mal für die 3.1.4.8 und die 5.0 gepostet aber man kann es wahrscheinlich auch für alle anderen Versionen nutzen.
3.1.4.8
C: fn_questionDealer.sqf
/*
File: fn_questionDealer.sqf
Author: Bryan "Tonic" Boardwine
modified by moeck (Lost of Paradise)
Description:
Questions the drug dealer and sets the sellers wanted.
*/
private["_sellers","_names","_players"];
_sellers = (_this select 0) getVariable["sellers",[]];
if(count _sellers == 0) exitWith {hint localize "STR_Cop_DealerQuestion"}; //No data.
life_action_inUse = true;
_names = "";
_players =[];
{ _players pushBackUnique (getPlayerUID _x); } forEach allPlayers;
{
if(_x select 2 > 150000) then
{
_val = round((_x select 2) / 16);
};
if (_x select 0 in _players) then {
[[_x select 0,_x select 1,"483",_val],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
};
_names = _names + format["%1<br/>",_x select 1];
} foreach _sellers;
hint parseText format[(localize "STR_Cop_DealerMSG")+ "<br/><br/>%1",_names];
(_this select 0) setVariable["sellers",[],true];
life_action_inUse = false;
Alles anzeigen
5.0
C: fn_questiondealer.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_questionDealer.sqf
Author: Bryan "Tonic" Boardwine
modified by moeck (Lost of Paradise)
Description:
Questions the drug dealer and sets the sellers wanted.
*/
private ["_sellers","_crimes","_names","_players"];
_sellers = (_this select 0) getVariable ["sellers",[]];
if (count _sellers isEqualTo 0) exitWith {hint localize "STR_Cop_DealerQuestion"}; //No data.
life_action_inUse = true;
_crimes = LIFE_SETTINGS(getArray,"crimes");
_players =[];
{ _players pushBackUnique (getPlayerUID _x); } forEach allPlayers;
_names = "";
{
_val = 0;
if ((_x select 2) > 150000) then {
_val = round((_x select 2) / 16);
} else {
_val = ["483",_crimes] call TON_fnc_index;
_val = ((_crimes select _val) select 1);
if (_val isEqualType "") then {
_val = parseNumber _val;
};
};
if (_x select 0 in _players) then {
[(_x select 0),(_x select 1),"483",_val] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
_names = _names + format ["%1<br/>",(_x select 1)];
} forEach _sellers;
hint parseText format [(localize "STR_Cop_DealerMSG")+ "<br/><br/>%1",_names];
(_this select 0) setVariable ["sellers",[],true];
life_action_inUse = false;<p>
</p>
<p></p>
Alles anzeigen
Gruß,
moeck