Hallo liebe NN-Community,
Leider muss ich schon wieder nach eurer Hilfe Fragen, ich hab folgendes Problem wir haben einige Delikte in unser Wanted hinzugefügt jedoch haben wir jetzt irgendwie das Problem das wir keine Spieler mehr sehen bzw auch nix mehr eintragen können es kommt immer der Fehler: Failed to fetch crimes
Code
#include <macro.h>
/*
File: fn_wantedMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Opens the Wanted menu and connects to the APD.
*/
private["_display","_list","_name","_crimes","_bounty","_units"];
disableSerialization;
createDialog "life_wanted_menu";
_display = findDisplay 2400;
_list = _display displayCtrl 2401;
lbClear _list;
_units = [];
ctrlSetText[2404,"Verbindung wird hergestellt..."];
[[player],"life_fnc_wantedFetch",false,false] spawn life_fnc_MP;
Alles anzeigen
unsere wantedInfo.sqf
Code
/*
File: fn_wantedInfo.sqf
Author: Bryan "Tonic" Boardwine
Description:
Pulls back information about the wanted criminal.
*/
private["_display","_list","_crimes","_bounty","_mylist"];
disableSerialization;
_display = findDisplay 2400;
_list = _display displayCtrl 2402;
_data = lbData[2401,(lbCurSel 2401)];
_mylist = [];
_data = call compile format["%1", _data];
if(isNil "_data") exitWith {_list lbAdd "Failed to fetch crimes";};
if(typeName _data != "ARRAY") exitWith {_list lbAdd "Failed to fetch crimes";};
if(count _data == 0) exitWith {_list lbAdd "Failed to fetch crimes";};
lbClear _list;
_crimes = _data select 2;
_bounty = _data select 3;
{
_crime = _x;
if(!(_crime in _mylist)) then
{
_mylist set[count _mylist,_crime];
_list lbAdd format["%1 count(s) of %2",{_x == _crime} count _crimes,_crime];
};
} foreach _crimes;
ctrlSetText[2403,format["Current Bounty Price: $%1",[_bounty] call life_fnc_numberText]];
Alles anzeigen
Unsere wanted2.sgf
Code
private["_unit","_amount"];
ctrlShow[2001,false];
if((lbCurSel 9902) == -1) exitWith {hintSilent "Niemand wurde ausgewaehlt!";ctrlShow[2001,true];};
_unit = lbData [9902,lbCurSel 9902];
_unit = call compile format["%1",_unit];
_amount = lbData [9991,lbCurSel 9991];
if(isNil "_unit") exitWith {ctrlShow[2001,true];};
//if(_unit == player) exitWith {ctrlShow[2001,true];};
if(isNull _unit) exitWith {ctrlShow[2001,true];};
[[1,format["Nach %1 wird nun gefahndet.",name _unit,_amount,getPlayerUID _unit]],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
[[getPlayerUID _unit,name _unit,_amount],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
Alles anzeigen
Unsere wantedADD.sqf
Code
/*
File: fn_wantedAdd.sqf
Author: Bryan "Tonic" Boardwine
Description:
Adds or appends a unit to the wanted list.
*/
private["_uid","_type","_index","_data","_crimes","_val","_customBounty","_name"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_type = [_this,2,"",[""]] call BIS_fnc_param;
_customBounty = [_this,3,-1,[0]] call BIS_fnc_param;
if(_uid == "" OR _type == "" OR _name == "") exitWith {}; //Bad data passed.
//What is the crime?
switch(_type) do
{
case "187V": {_type = ["Überfahren eines Buergers",]50000};
case "187": {_type = ["Mord",50000]};
case "901": {_type = ["Ausbruch aus dem Gefängnis",500000]};
case "261": {_type = ["Rape",5000]};
case "261A": {_type = ["Attempted Rape",3000]};
case "215": {_type = ["Versuchter Fahrzeugdiebstahl",10000]};
case "213": {_type = ["Benutzung von Sprengstoff",10000]};
case "211": {_type = ["Tankstellen Ueberfall",60000]};
case "207": {_type = ["Geiselnahme",100000]};
case "207A": {_type = ["Versuchte Geiselnahme",50000]};
case "487": {_type = ["Fahrzeugdiebstahl",20000]};
case "488": {_type = ["Diebstahl",15000]};
case "480": {_type = ["Hit and run",1300]};
case "481": {_type = ["Drogenbesitz bis zu 10kg",500000]};
case "482": {_type = ["Intent to distribute",5000]};
case "483": {_type = ["Drogenhandel",500000]};
case "459": {_type = ["Hauseinbruch",50000]};
case "390": {_type = ["Fahren unter Alkoholeinfluss",15000]};
case "919": {_type = ["Organ Handel",50000]};
case "222": {_type = ["Raubüberfall eines ATM",60000]};
case "1": {_type = ["Fahren ohne Fuehrerschein",15000]};
case "2": {_type = ["Versuchter Fahrzeugdiebstahl",10000]};
case "3": {_type = ["Fuehren eines gestohlenen Fahrzeugs",20000]};
case "4": {_type = ["Fahren ohne Licht",1500]};
case "5": {_type = ["Ueberhoehte Geschwindigkeit",6000]};
case "6": {_type = ["Gefaehrliche Fahrweise",7500]};
case "7": {_type = ["Versuchter Diebstahl e. Polizeifahrzeugs",15000]};
case "8": {_type = ["Diebstahl von Polizeifahrzeugen",25000]};
case "9": {_type = ["Landen ohne Genehmigung",20000]};
case "10": {_type = ["Fahren von illegalen Fahrzeugen", 100000]};
case "11": {_type = ["Unfallverursacher / Fahrerflucht nach Unfall",5000]};
case "12": {_type = ["Flucht vor der Polizei",17500]};
case "13": {_type = ["Ueberfahren eines anderen Bewohners",30000]};
case "14": {_type = ["Illegale Strassensperren",15000]};
case "15": {_type = ["Widerstand gegen die Staatsgewalt",45000]};
case "16": {_type = ["Nicht befolgen e. pol. Anordnung",5000]};
case "17": {_type = ["Beamtenbeleidigung",15000]};
case "18": {_type = ["Belaestigung eines Polizisten",14000]};
case "19": {_type = ["Betreten einer pol. Sperrzone",50000]};
case "20": {_type = ["Toeten eines Polizisten",500000]};
case "21": {_type = ["Beschuss auf Polizei/Beamte/Feuerwehr",152000]};
case "22": {_type = ["Zerstoerung von Polizeieigentum",150000]};
case "23": {_type = ["Töten eines Arztes",500000]};
case "24": {_type = ["Waffenbesitz ohne Lizenz",70000]};
case "25": {_type = ["Mit gez. Waffe durch die Stadt",50000]};
case "26": {_type = ["Besitz einer illegalen Waffe",150000]};
case "27": {_type = ["Abfeuern einer Waffe",50000]};
case "28": {_type = ["Geiselnahme",500000]};
case "29": {_type = ["Raubeuberfall",60000]};
case "30": {_type = ["Bankraub",750000]};
case "31": {_type = ["Mord",50000]};
case "32": {_type = ["Aufstand",75000]};
case "33": {_type = ["Angriff durch Rebellen oder Mafioso",75000]};
case "34": {_type = ["Angriff/Belagerung von Staedten/Checkpoints",400200]};
case "35": {_type = ["Landung in einer Flugverbotszone",75000]};
case "36": {_type = ["Fliegen/Schweben unterhalb 150m ueber Stadt",20000]};
case "37": {_type = ["Ausbruch aus dem Gefaengnis",500000]};
case "38": {_type = ["Fliegen ohne Fluglizenz",50000]};
case "39": {_type = ["Dauerhaftes Hupen",7500]};
case "40": {_type = ["Handel mit exotischen Guetern",50000]};
case "41": {_type = ["Umfahren eines Außenpostens",25000]};
case "42": {_type = ["Vergewaltigung",50000]};
case "43": {_type = ["Entfuehrung eines Staatsoberhauptes",5000000]};
case "44": {_type = ["Geldtransport Ueberfall",2000000]};
case "45": {_type = ["Aufenthalt nur in Unterwäsche",1500]};
case "46": {_type = ["Maskierte Personen",10000]};
case "47": {_type = ["Hovern ue. Staedten oder Spaehen",100000]};
case "48": {_type = ["Erregung in der Oeffentlichkeit",8000]};
case "49": {_type = ["Überhöte Geschwindigkeit via Radar",5000]};
case "120S": {_type = ["Überhöte Geschwindigkeit",5000]};
case "120H": {_type = ["Gewohntes Fahren",8000]};
case "120WL": {_type = ["Driving W/O License",8000]};
case "120FS": {_type = ["Gefährliche Fahrweise",8000]};
default {_type = [];};
};
if(count _type == 0) exitWith {}; //Not our information being passed...
//Is there a custom bounty being sent? Set that as the pricing.
if(_customBounty != -1) then {_type set[1,_customBounty];};
//Search the wanted list to make sure they are not on it.
_index = [_uid,life_wanted_list] call TON_fnc_index;
if(_index != -1) then
{
_data = life_wanted_list select _index;
_crimes = _data select 2;
_crimes pushBack (_type select 0);
_val = _data select 3;
life_wanted_list set[_index,[_name,_uid,_crimes,(_type select 1) + _val]];
}
else
{
life_wanted_list pushBack [_name,_uid,[(_type select 0)],(_type select 1)];
};
Alles anzeigen
Ich hoffe ihr könnt uns da weiterhelfen ich bin glaub zu blind um den fehler zu finden.
Danke euch schonmal