Beiträge von ChickenWeed
-
-
-
C
_random = random 3; if(_random != 2) exitWith { hint "Scheiße... Es hat nicht geklappt, vielleicht sollte ich es nochmal probieren?!";//33% [[getPlayerUID _ausbrecher,name _ausbrecher,"902"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP; //Kommt auf die WantedListe Life_atmcash = Life_atmcash - _ticketkosten; //Ticket kosten werden erst dann abgezogen! sleep 6; hint format["Nicht vergessen damit kommst du wieder auf die Fahndungsliste und hast %1€ gezahlt!",_ticketkosten]; };
Hier nochmal der komplette exitWith Code dafür!
-
Hey ich schreibe jetzt seit 2 Tage an einem Gefängnis System, dass ich auch gerne releasen werde. Mein Problem ist ich hänge bei der random chance auszubrechen fest..
C_random = random 3; if(_random != 2) exitWith {hint "Scheiße... Es hat nicht geklappt, vielleicht sollte ich es nochmal probieren?!";
Hier sollte man 33,33% haben es zu schaffen wenn die 2 genommen wird. Nur irgendwie habe ich 100 mal probiert und immer nicht geschafft und ich glaube nicht das ich einfach nur Pech habe und die 33,33% nicht treffe!So habe ich es auch probiert:
Cchance = random(100); if(_chance >= 25) exitWith { hint "Scheiße... Es hat nicht geklappt, vielleicht sollte ich es nochmal probieren?!";
Hier wurden 25% definiert...
Hat da vielleicht jemand ne Idee oder habe ich da was über sehen?
PS: Die array Variante habe ich auch schon probiert.
Mfg Pius von Team-Wings
-
hat jetzt geklappt danke!
-
-
-
-
Benutze die du hochgeladen hast die habe ich eingefügt!
-
Leider nicht man brauch kein Geld mehr um was zu kaufen alles ist free wenn man 0 dabei hat geht man in so ein - Bereich und alles ist komisch man kann sich alles kaufen ohne Geld..
-
Ist das die fertige Datei die klappen sollte zum download?
-
Was meinst du genau?
-
Logs sagen nichts... die Datei sieht jetzt so aus!
C
Alles anzeigen/* File: fn_vehicleShopBuy.sqf Author: Bryan "Tonic" Boardwine Description: Does something with vehicle purchasing. */ private["_mode","_spawnPoints","_className","_basePrice","_rentPrice","_colorIndex","_spawnPoint","_vehicle"]; _mode = _this select 0; if((lbCurSel 2302) == -1) exitWith {hintSilent localize "STR_Shop_Veh_DidntPick"}; _className = lbData[2302,(lbCurSel 2302)]; _vIndex = lbValue[2302,(lbCurSel 2302)]; _vehicleList = [life_veh_shop select 0] call life_fnc_vehicleListCfg; _basePrice = (_vehicleList select _vIndex) select 1; _rentPrice = (_vehicleList select _vIndex) select 2; _colorIndex = lbValue[2304,(lbCurSel 2304)]; //Series of checks (YAY!) if(_basePrice < 0) exitWith {closeDialog 0;}; //Bad price entry if(_rentPrice < 0) exitWith {closeDialog 0;}; //Bad price entry if(life_cash < _rentPrice) exitWith {hint format[localize "STR_Shop_Veh_NotEnough",[_rentPrice - life_cash] call life_fnc_numberText];closeDialog 0;}; if(life_cash < _basePrice) exitWith {hintSilent format[localize "STR_Shop_Veh_NotEnough",[_basePrice - life_cash] call life_fnc_numberText];closeDialog 0;}; if(!([_className] call life_fnc_vehShopLicenses) && _className != "B_MRAP_01_hmg_F") exitWith {hintSilent localize "STR_Shop_Veh_NoLicense"; closeDialog 0;}; _spawnPoints = life_veh_shop select 1; _spawnPoint = ""; if((life_veh_shop select 0) == "med_air_hs") then { if(count(nearestObjects[(getMarkerPos _spawnPoints),["Air"],35]) == 0) exitWith {_spawnPoint = _spawnPoints}; } else { //Check if there is multiple spawn points and find a suitable spawnpoint. if(typeName _spawnPoints == typeName []) then { //Find an available spawn point. {if(count(nearestObjects[(getMarkerPos _x),["Car","Ship","Air"],5]) == 0) exitWith {_spawnPoint = _x};} foreach _spawnPoints; } else { if(count(nearestObjects[(getMarkerPos _spawnPoints),["Car","Ship","Air"],5]) == 0) exitWith {_spawnPoint = _spawnPoints}; }; }; if(_spawnPoint == "") exitWith {hintSilent localize "STR_Shop_Veh_Block"; closeDialog 0;}; if _mode then { if(life_cash < _basePrice) exitWith {hintSilent format[localize "STR_Shop_Veh_NotEnough",[_basePrice - life_cash] call life_fnc_numberText];closeDialog 0;}; }else{ if(life_cash < _rentPrice) exitWith {hint format[localize "STR_Shop_Veh_NotEnough",[_rentPrice - life_cash] call life_fnc_numberText];closeDialog 0;}; }; //Spawn the vehicle and prep it. if((life_veh_shop select 0) == "med_air_hs") then { _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"]; waitUntil {!isNil "_vehicle"}; //Wait? _vehicle allowDamage false; _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0; _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]); _vehicle lock 2; [[_vehicle,_colorIndex],"life_fnc_colorVehicle",true,false] spawn life_fnc_MP; [_vehicle] call life_fnc_clearVehicleAmmo; [[_vehicle,"trunk_in_use",false,true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; [[_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. } else { _vehicle = createVehicle [_className, (getMarkerPos _spawnPoint), [], 0, "NONE"]; waitUntil {!isNil "_vehicle"}; //Wait? _vehicle allowDamage false; //Temp disable damage handling.. _vehicle lock 2; _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint)); _vehicle setDir (markerDir _spawnPoint); _vehicle setPos (getMarkerPos _spawnPoint); [[_vehicle,_colorIndex],"life_fnc_colorVehicle",true,false] spawn life_fnc_MP; [_vehicle] call life_fnc_clearVehicleAmmo; [[_vehicle,"trunk_in_use",false,true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; [[_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. }; //Side Specific actions. switch(playerSide) do { case west: { [_vehicle,"cop_offroad",true] spawn life_fnc_vehicleAnimate; }; case civilian: { if((life_veh_shop select 2) == "civ" && {_className == "B_Heli_Light_01_F"}) then { [_vehicle,"civ_littlebird",true] spawn life_fnc_vehicleAnimate; }; }; case independent: { [_vehicle,"med_offroad",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_hemmtt",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_van",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_I_Heli",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_O_Heli",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_B_Heli",true] spawn life_fnc_vehicleAnimate; [_vehicle,"med_Heli",true] spawn life_fnc_vehicleAnimate; }; }; _vehicle allowDamage true; //life_vehicles set[count life_vehicles,_vehicle]; //Add err to the chain. life_vehicles pushBack _vehicle; [[getPlayerUID player,playerSide,_vehicle,1],"TON_fnc_keyManagement",false,false] spawn life_fnc_MP; if(_mode) then { if(!(_className in ["B_G_Offroad_01_armed_F","B_MRAP_01_hmg_F"])) then { [[(getPlayerUID player),playerSide,_vehicle,_colorIndex],"TON_fnc_vehicleCreate",false,false] spawn life_fnc_MP; }; }; [0] call SOCK_fnc_updatePartial; closeDialog 0; //Exit the menu. true;
-
Naja jetzt kannst du jedes Auto kaufen und musst nicht zahlen er zieht garkein geld mehr ab! ...
-
-
Wann bist du morgen bzw. Heute erreichbar?
-
Bin jetzt nicht mehr am Pc. Naher
-
-
Habe noch paar abfragen erstellt und auch nur das man alle 20 Sekunden das machen kann + in einem Auto sein muss!
-
Hey habe das Skill System für die 3.1.4.8 eingefügt und wenn ich jetzt joine lädt er nicht mehr. Er wartet nur für meine UID.
Das hier habe ich in den Logs gefunden!Code
Alles anzeigen}; waitUntil{sleep (random 0.3); !DB_Async_Active}; _tickTime = diag_tickT> 22:38:52 Error position: <DB_Async_Active}; _tickTime = diag_tickT> 22:38:52 Error Undefined variable in expression: db_async_active 22:38:52 File life_server\Functions\MySQL\fn_queryRequest.sqf, line 28 22:38:52 Error in expression <d];}; }; waitUntil{sleep (random 0.3); !DB_Async_Active}; _tickTime = diag_tickT> 22:38:52 Error position: <DB_Async_Active}; _tickTime = diag_tickT> 22:38:52 Error Undefined variable in expression: db_async_active 22:38:52 File life_server\Functions\MySQL\fn_queryRequest.sqf, line 28
Kann mir da vielleicht helfen?C: queryRequest.sqf
Alles anzeigen/* File: fn_queryRequest.sqf Author: Bryan "Tonic" Boardwine Description: Handles the incoming request and sends an asynchronous query request to the database. Return: ARRAY - If array has 0 elements it should be handled as an error in client-side files. STRING - The request had invalid handles or an unknown error and is logged to the RPT. */ private["_uid","_side","_query","_return","_queryResult","_qResult","_handler","_thread","_tickTime","_loops","_returnCount"]; _uid = [_this,0,"",[""]] call BIS_fnc_param; _side = [_this,1,sideUnknown,[civilian]] call BIS_fnc_param; _ownerID = [_this,2,ObjNull,[ObjNull]] call BIS_fnc_param; if(isNull _ownerID) exitWith {}; _ownerID = owner _ownerID; /* _returnCount is the count of entries we are expecting back from the async call. The other part is well the SQL statement. */ _query = switch(_side) do { case west: {_returnCount = 10; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, cop_licenses, coplevel, cop_gear, cop_prof, blacklist FROM players WHERE playerid='%1'",_uid];}; case civilian: {_returnCount = 9; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear, civ_prof FROM players WHERE playerid='%1'",_uid];}; case independent: {_returnCount = 9; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, med_licenses, mediclevel, med_gear, med_prof FROM players WHERE playerid='%1'",_uid];}; }; waitUntil{sleep (random 0.3); !DB_Async_Active}; _tickTime = diag_tickTime; _queryResult = [_query,2] call DB_fnc_asyncCall; diag_log "------------- Client Query Request -------------"; diag_log format["QUERY: %1",_query]; diag_log format["Time to complete: %1 (in seconds)",(diag_tickTime - _tickTime)]; diag_log format["Result: %1",_queryResult]; diag_log "------------------------------------------------"; if(typeName _queryResult == "STRING") exitWith { [[],"SOCK_fnc_insertPlayerInfo",_ownerID,false,true] spawn life_fnc_MP; }; if(count _queryResult == 0) exitWith { [[],"SOCK_fnc_insertPlayerInfo",_ownerID,false,true] spawn life_fnc_MP; }; //Blah conversion thing from a2net->extdb private["_tmp"]; _tmp = _queryResult select 2; _queryResult set[2,[_tmp] call DB_fnc_numberSafe]; _tmp = _queryResult select 3; _queryResult set[3,[_tmp] call DB_fnc_numberSafe]; //Parse licenses (Always index 6) _new = [(_queryResult select 6)] call DB_fnc_mresToArray; if(typeName _new == "STRING") then {_new = call compile format["%1", _new];}; _queryResult set[6,_new]; //Convert tinyint to boolean _old = _queryResult select 6; for "_i" from 0 to (count _old)-1 do { _data = _old select _i; _old set[_i,[_data select 0, ([_data select 1,1] call DB_fnc_bool)]]; }; _queryResult set[6,_old]; _new = [(_queryResult select 8)] call DB_fnc_mresToArray; if(typeName _new == "STRING") then {_new = call compile format["%1", _new];}; _queryResult set[8,_new]; //PROFICENCYS //Parse licenses (Always index 9) _new = [(_queryResult select 9)] call DB_fnc_mresToArray; if(typeName _new == "STRING") then {_new = call compile format["%1", _new];}; _queryResult set[9,_new]; //Convert string to number _old = _queryResult select 9; for "_i" from 0 to (count _old)-1 do { _data = _old select _i; _old set[_i,[_data select 0, ([_data select 1,1] call DB_fnc_numberSafe),([_data select 2,1] call DB_fnc_numberSafe) ]]; }; _queryResult set[9,_old]; //Parse data for specific side. switch (_side) do { case west: { _queryResult set[10,([_queryResult select 10,1] call DB_fnc_bool)]; }; case civilian: { _queryResult set[7,([_queryResult select 7,1] call DB_fnc_bool)]; _houseData = _uid spawn TON_fnc_fetchPlayerHouses; waitUntil {scriptDone _houseData}; _queryResult pushBack (missionNamespace getVariable[format["houses_%1",_uid],[]]); _gangData = _uid spawn TON_fnc_queryPlayerGang; waitUntil{scriptDone _gangData};_queryResult pushBack (missionNamespace getVariable[format["gang_%1",_uid],[]]); }; }; _keyArr = missionNamespace getVariable [format["%1_KEYS_%2",_uid,_side],[]]; _queryResult set[13,_keyArr]; [_queryResult,"SOCK_fnc_requestReceived",_ownerID,false] spawn life_fnc_MP;
Danke im Voraus!
Mfg Pius von Team-Wings