Ich dachte hier geht es um Autos
Ja das dachte ich mir auch aber mit so einer komischen Begründung muss man halt nochmal nachfragen.
Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.
Ich dachte hier geht es um Autos
Ja das dachte ich mir auch aber mit so einer komischen Begründung muss man halt nochmal nachfragen.
Ja müsstest die pbo öffnen und die entsprechenden Dateien anschauen.
Verschiedene Aufforderungen ("pull over", "driver step out of the vehicle", "passenger step out of the vehicle")
Sowas ist nicht wirklich schwer ^^. Seine 3d-Modelles finde ich persönlich echt nicht schlecht .
Da habe ich ja etwas gekauft kriege aber nur BIlder und keine models etc
Dann schreib ihn mal an. Auf der Seite
wie heißt die oder link?
Sehe gerade das FB-Seite nicht mehr gibt lol
Sonst nur noch das hier: Mr.Shounka : Founder Pack 2017 | Mr.Shounka - Sellfy.com
keine ahnung ob da irgendwas noch freigeschaltet wird oder ob das Fake ist...
Kauf es auf seiner FB Seite. Hab es dort auch gekauft
ist es eigentlich egal in welcher reihenfloge cop prof usw in der life server stehen? bei query und dem andere
Da bin ich mir nicht sicher. Hier sind die codes aus der 3.1.4.8 :
Server:
fn_Updaterequest.sqf replace
/*
File: fn_updateRequest.sqf
Author: Bryan "Tonic" Boardwine
Description:
Ain't got time to describe it, READ THE FILE NAME!
*/
private["_uid","_side","_cash","_bank","_licenses","_gear","_name","_query","_thread"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_side = [_this,2,sideUnknown,[civilian]] call BIS_fnc_param;
_cash = [_this,3,0,[0]] call BIS_fnc_param;
_bank = [_this,4,5000,[0]] call BIS_fnc_param;
_licenses = [_this,5,[],[[]]] call BIS_fnc_param;
_gear = [_this,6,[],[[]]] call BIS_fnc_param;
_prof = [_this, 7,[],[[]]] call BIS_fnc_param;
//Get to those error checks.
if((_uid == "") OR (_name == "")) exitWith {};
//Parse and setup some data.
_name = [_name] call DB_fnc_mresString;
_gear = [_gear] call DB_fnc_mresArray;
_cash = [_cash] call DB_fnc_numberSafe;
_bank = [_bank] call DB_fnc_numberSafe;
//Does something license related but I can't remember I only know it's important?
for "_i" from 0 to count(_licenses)-1 do {
_bool = [(_licenses select _i) select 1] call DB_fnc_bool;
_licenses set[_i,[(_licenses select _i) select 0,_bool]];
};
_licenses = [_licenses] call DB_fnc_mresArray;
_prof = [_prof] call DB_fnc_mresArray;
switch (_side) do {
case west: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_prof='%7' WHERE playerid='%6'",_name,_cash,_bank,_gear,_licenses,_uid,_prof];};
case civilian: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%6', arrested='%7', civ_prof='%8' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,[_this select 8] call DB_fnc_bool,_prof];};
case independent: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%6',med_prof='%7' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,_prof];};
};
waitUntil {sleep (random 0.3); !DB_Async_Active};
_queryResult = [_query,1] call DB_fnc_asyncCall;
fn_QueryRequest.sqf: replace all
/*
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 = 11; 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 = 10; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear, civ_prof FROM players WHERE playerid='%1'",_uid];};
case independent: {_returnCount = 10; 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;
Alles anzeigen
Irgendwo muss ein Fehler in der @Life_server sein.
PS. Würde den Schwierigkeitsgrad auf 5 stellen(zumindest zum jetzigen Zeitpunkt)
Ich schaue mal in die 2 Live Dateien übers Wochenende.
Fehlermeldung als ich in die Datenbank machen wollte
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`players` ADD COLUMN `cop_prof` TEXT NULL DEFAULT NULL AFTER `blacklist`,ADD COL' at line 1
[Err] ALTER TABLE `altislife`,`players` ADD COLUMN `cop_prof` TEXT NULL DEFAULT NULL AFTER `blacklist`,ADD COLUMN `civ_prof` TEXT NULL DEFAULT NULL AFTER `cop_prof`,ADD COLUMN `med_prof` TEXT NULL DEFAULT NULL AFTER `civ_prof`;
[Msg] Finished - Unsuccessfully
------------------------------------------------
Okay gut zu wissen . Versuch die cop_prof, civ_prof, med_prof einzeln in die Datenbank einzufügen.
Mfg
AmaZiinG
Cooles Dingen, ich warte noch ein bisschen die Rezensionen ab, und werde es dann auch testen
Meinst du das Funktioniert auf der 4.4.R4 vanilla direkt?
Dürfte eigentlich gehen ^^. Bin mir aber nicht zu 100% sicher.
Du solltest vlt nur das immer schreiben was sie reinpacken bzw. ändern müssen und nicht direkt die ganze Datei ersetzten Sonst super!
In den Dateien sind alle Codes vom Level System mit //Level System gekennzeichnet.
Live_Server
14. Ersetzt in der fn_Updaterequest.sqf alles durch das:
/*
File: fn_updateRequest.sqf
Author: Bryan "Tonic" Boardwine
Edit by AmaZiinG for the level system
P.S. - Don't be a faggot like i know some of you all will be.
Description:
Ain't got time to describe it, READ THE FILE NAME!
*/
private["_uid","_side","_cash","_bank","_licenses","_gear","_stats","_name","_alive","_position","_query","_thread"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_side = [_this,2,sideUnknown,[civilian]] call BIS_fnc_param;
_cash = [_this,3,0,[0]] call BIS_fnc_param;
_bank = [_this,4,5000,[0]] call BIS_fnc_param;
_licenses = [_this,5,[],[[]]] call BIS_fnc_param;
_gear = [_this,6,[],[[]]] call BIS_fnc_param;
_stats = [_this,7,[100,100],[[]]] call BIS_fnc_param;
_alive = [_this,9,0,[0]] call BIS_fnc_param;
_position = [_this,10,[],[[]]] call BIS_fnc_param;
_prof = [_this, 7,[],[[]]] call BIS_fnc_param; //Level System
//Get to those error checks.
if ((_uid isEqualTo "") || (_name isEqualTo "")) exitWith {};
//Parse and setup some data.
_name = [_name] call DB_fnc_mresString;
_gear = [_gear] call DB_fnc_mresArray;
_stats = [_stats] call DB_fnc_mresArray;
_cash = [_cash] call DB_fnc_numberSafe;
_bank = [_bank] call DB_fnc_numberSafe;
_position = if (_side isEqualTo civilian) then {[_position] call DB_fnc_mresArray} else {[]};
//Does something license related but I can't remember I only know it's important?
for "_i" from 0 to count(_licenses)-1 do {
_bool = [(_licenses select _i) select 1] call DB_fnc_bool;
_licenses set[_i,[(_licenses select _i) select 0,_bool]];
};
_licenses = [_licenses] call DB_fnc_mresArray;
_prof = [_prof] call DB_fnc_mresArray;//level System
//PLAYTIME
_playtime = [_uid] call TON_fnc_getPlayTime;
_playtime_update = [];
{
if ((_x select 0) isEqualTo _uid) exitWith
{
_playtime_update pushBack [_x select 1];
};
} forEach TON_fnc_playtime_values_request;
_playtime_update = (_playtime_update select 0) select 0;
switch (_side) do {
case west: {_playtime_update set[0,_playtime];};
case civilian: {_playtime_update set[2,_playtime];};
case independent: {_playtime_update set[1,_playtime];};
};
_playtime_update = [_playtime_update] call DB_fnc_mresArray;
switch (_side) do {
case west: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_stats='%6', playtime='%7', cop_prof='%8' WHERE playerid='%8'",_name,_cash,_bank,_gear,_licenses,_stats,_playtime_update,_uid,_prof];}; //level System
case civilian: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%5', arrested='%6', civ_stats='%7', civ_alive='%8', civ_position='%9', playtime='%10', civ_prof='%11' WHERE playerid='%11'",_name,_cash,_bank,_licenses,_gear,[_this select 8] call DB_fnc_bool,_stats,[_this select 9] call DB_fnc_bool,_position,_playtime_update,_uid,_prof];}; //level System
case independent: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%5', med_stats='%6', playtime='%7', med_prof='%8' WHERE playerid='%8'",_name,_cash,_bank,_licenses,_gear,_stats,_playtime_update,_uid,_prof];}; //level System
};
_queryResult = [_query,1] call DB_fnc_asyncCall;
Alles anzeigen
14. Ersetzt in der fn_QueryRequest.sqf alles durch das:
#include "\life_server\script_macros.hpp"
/*
File: fn_queryRequest.sqf
Author: Bryan "Tonic" Boardwine
Edit by AmaZiinG for the level system
P.S. - Don't be a faggot like i know some of you all will be.
Description:
Handles the incoming request and sends an asynchronous query
request to the database.
*/
private["_uid","_side","_query","_queryResult","_tickTime","_tmp"];
_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;
_query = switch (_side) do {
// West - 11 entries returned
case west: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, cop_prof, blacklist, cop_stats, playtime FROM players WHERE playerid='%1'",_uid];}; //level System
// Civilian - 12 entries returned
case civilian: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, civ_licenses, arrested, civ_gear, civ_prof, civ_stats, civ_alive, civ_position, playtime FROM players WHERE playerid='%1'",_uid];}; //level System
// Independent - 10 entries returned
case independent: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, med_licenses, mediclevel, med_gear, med_prof, med_stats, playtime FROM players WHERE playerid='%1'",_uid];}; //level System
};
_tickTime = diag_tickTime;
_queryResult = [_query,2] call DB_fnc_asyncCall;
if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
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 (_queryResult isEqualType "") exitWith {
[] remoteExecCall ["SOCK_fnc_insertPlayerInfo",_ownerID];
};
if (count _queryResult isEqualTo 0) exitWith {
[] remoteExecCall ["SOCK_fnc_insertPlayerInfo",_ownerID];
};
//Blah conversion thing from a2net->extdb
_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 (_new isEqualType "") 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 (_new isEqualType "") then {_new = call compile format["%1", _new];};
_queryResult set[8,_new];
//Level System for 4.4 R3
//Parse licenses (Always index 9)
_new = [(_queryResult select 9)] call DB_fnc_mresToArray;
if(_new isEqualType "") 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[9,([_queryResult select 9,1] call DB_fnc_bool)];
//Parse Stats
_new = [(_queryResult select 10)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_queryResult set[10,_new];
//Playtime
_new = [(_queryResult select 11)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_index = TON_fnc_playtime_values_request find [_uid, _new];
if (_index != -1) then {
TON_fnc_playtime_values_request set[_index,-1];
TON_fnc_playtime_values_request = TON_fnc_playtime_values_request - [-1];
TON_fnc_playtime_values_request pushBack [_uid, _new];
} else {
TON_fnc_playtime_values_request pushBack [_uid, _new];
};
[_uid,_new select 0] call TON_fnc_setPlayTime;
};
case civilian: {
_queryResult set[7,([_queryResult select 7,1] call DB_fnc_bool)];
//Parse Stats
_new = [(_queryResult select 9)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_queryResult set[9,_new];
//Position
_queryResult set[10,([_queryResult select 10,1] call DB_fnc_bool)];
_new = [(_queryResult select 11)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_queryResult set[11,_new];
//Playtime
_new = [(_queryResult select 12)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_index = TON_fnc_playtime_values_request find [_uid, _new];
if (_index != -1) then {
TON_fnc_playtime_values_request set[_index,-1];
TON_fnc_playtime_values_request = TON_fnc_playtime_values_request - [-1];
TON_fnc_playtime_values_request pushBack [_uid, _new];
} else {
TON_fnc_playtime_values_request pushBack [_uid, _new];
};
[_uid,_new select 2] call TON_fnc_setPlayTime;
_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],[]]);
};
case independent: {
//Parse Stats
_new = [(_queryResult select 9)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_queryResult set[9,_new];
//Playtime
_new = [(_queryResult select 10)] call DB_fnc_mresToArray;
if (_new isEqualType "") then {_new = call compile format["%1", _new];};
_index = TON_fnc_playtime_values_request find [_uid, _new];
if (_index != -1) then {
TON_fnc_playtime_values_request set[_index,-1];
TON_fnc_playtime_values_request = TON_fnc_playtime_values_request - [-1];
TON_fnc_playtime_values_request pushBack [_uid, _new];
} else {
TON_fnc_playtime_values_request pushBack [_uid, _new];
};
[_uid,_new select 1] call TON_fnc_setPlayTime;
};
};
publicVariable "TON_fnc_playtime_values_request";
_keyArr = missionNamespace getVariable [format["%1_KEYS_%2",_uid,_side],[]];
_queryResult set[16,_keyArr];
_queryResult remoteExec ["SOCK_fnc_requestReceived",_ownerID];
Alles anzeigen
Datenbank:
Fertig !
Wenn ihr Fehler bekommt postet sie unter dem TUT. So kann ich es ausbessern !
Ich hoffe ich konnte euch helfen mit diesen TUT.
Autor: PapaBear's
Edit by AmaZiinG
Infos: Die Weiterverbreitung in anderen Foren untersage ich (eine Erlaubnis ist bei mir einzuholen).
Wichtig: Macht bitte macht ein Backup davor !
Die Schritte: 10. und 7. könnten Fehlerhaft sein !!!!!!
Mission:
1. Geht in die Functions.h und schreibt unter class Functions da
2. tragt unter class Config das ein:
2. Schreibt folgendes in eure Masterhandler.h ein:
3. Stringable.xml fügt ihr ganz unten das ein:
<Package name="Life_Prof">
<Key ID="STR_Prof_Oil">
<Original>Oil Proficiency</Original>
<English>Oil Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Sand">
<Original>Sand Proficiency</Original>
<English>Sand Proficiency</English>
<German>Sand Können</German>
</Key>
<Key ID="STR_Prof_Rock">
<Original>Rock Proficiency</Original>
<English>Rock Proficiency</English>
<German>Rock Können</German>
</Key>
<Key ID="STR_Prof_Salt">
<Original>Salt Proficiency</Original>
<English>Salt Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Canabis">
<Original>Cannabis Proficiency</Original>
<English>Cannabis Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Heroin">
<Original>Heroin Proficiency</Original>
<English>Heroin Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Cocain">
<Original>Cocaine Proficiency</Original>
<English>Cocaine Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Diamond">
<Original>Diamond Proficiency</Original>
<English>Diamond Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Iron">
<Original>Iron Proficiency</Original>
<English>Iron Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Copper">
<Original>Copper Proficiency</Original>
<English>Copper Proficiency</English>
<German>Öl Können</German>
</Key>
<Key ID="STR_Prof_Fruit">
<Original>Fruit Proficiency</Original>
<English>Fruit Proficiency</English>
<German>Öl Können</German>
</Key>
</Package>
Alles anzeigen
4.In der Player_inv.hpp fügt ihr ganz unten das ein:
class ProfButton : life_RscButtonMenu {
text = "Proficiency";
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
onButtonClick = "[] call life_fnc_profSetup;";
x = 0.11;
y = 0.70;
w = (5.75 / 40);
h = (1 / 25);
};
5. In der Config_Licenses.hpp fügt ihr folgende Lizenzen hinzu:
class Licenses {
//Processing Licenses
class Oil_Prof {
variable = "Oil_Prof";
displayName = "STR_Prof_Oil";
price = 10000;
illegal = false;
side = "civ";
};
class Iron_Prof {
variable = "Iron_Prof";
displayName = "STR_Prof_Iron";
price = 35000;
illegal = false;
side = "civ";
};
class Copper_Prof {
variable = "Copper_Prof";
displayName = "STR_Prof_Copper";
price = 12000;
illegal = false;
side = "civ";
};
class Heroin_Prof {
variable = "Heroin_Prof";
displayName = "STR_Prof_Rock";
price = 14500;
illegal = false;
side = "civ";
};
class Canabis_Prof {
variable = "Canabis_Prof";
displayName = "STR_Prof_Canabis";
price = 9500;
illegal = false;
side = "civ";
};
class Cocain_Prof {
variable = "Cocain_Prof";
displayName = "STR_Prof_Cocain";
price = 8000;
illegal = false;
side = "civ";
};
class Fruit_Prof {
variable = "Fruit_Prof";
displayName = "STR_Prof_Fruit";
price = 6500;
illegal = false;
side = "civ";
};
class Diamond_Prof {
variable = "Diamond_Prof";
displayName = "STR_Prof_Diamond";
price = 15000;
illegal = false;
side = "civ";
};
class Rock_Prof {
variable = "Rock_Prof";
displayName = "STR_Prof_Rock";
price = 15000;
illegal = false;
side = "civ";
};
class Sand_Prof {
variable = "Sand_Prof";
displayName = "STR_Prof_Sand";
price = 15000;
illegal = false;
side = "civ";
};
};
Alles anzeigen
6. Ersetzt die fn_updateRequest durch das:
#include "..\..\script_macros.hpp"
/*
File: fn_updateRequest.sqf
Author: Tonic
Description:
Passes ALL player information to the server to save player data to the database.
Edit by AmaZiinG for the level system
P.S. - Don't be a faggot like i know some of you all will be.
*/
private["_packet","_array","_flag","_alive","_position"];
_packet = [getPlayerUID player,(profileName),playerSide,CASH,BANK];
_array = [];
_alive = alive player;
_position = getPosATL player;
_flag = switch (playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"};};
{
_varName = LICENSE_VARNAME(configName _x,_flag);
_array pushBack [_varName,LICENSE_VALUE(configName _x,_flag)];
} forEach (format["getText(_x >> 'side') isEqualTo '%1'",_flag] configClasses (missionConfigFile >> "Licenses"));
_packet pushBack _array;
[] call life_fnc_saveGear;
_packet pushBack life_gear;
_profs = []; //LevelSystem
{
if(_x select 1 == _flag) then
{
_data = missionNamespace getVariable (_x select 0);
_profs pushBack [_x select 0,_data select 0,_data select 1];
};
} foreach life_prof;
_packet pushBack _profs;//Level SYstem Ende
_array = [];
_array pushBack life_hunger;
_array pushBack life_thirst;
_array pushBack (damage player);
_packet pushBack _array;
switch (playerSide) do {
case civilian: {
_packet pushBack life_is_arrested;
_packet pushBack _alive;
_packet pushBack _position;
};
};
if (life_HC_isActive) then {
_packet remoteExecCall ["HC_fnc_updateRequest",HC_Life];
} else {
_packet remoteExecCall ["DB_fnc_updateRequest",RSERV];
};
Alles anzeigen
7. Ersetzt eure Fn_processaction.sqf durch das:
#include "..\..\script_macros.hpp"
/*
File: fn_processAction.sqf
Author: Bryan "Tonic" Boardwine
Modified : NiiRoZz
Description:
Master handling for processing an item.
NiiRoZz : Added multiprocess
*/
private["_vendor","_type","_itemInfo","_oldItem","_newItemWeight","_newItem","_oldItemWeight","_cost","_upp","_hasLicense","_itemName","_oldVal","_ui","_progress","_pgText","_cP","_materialsRequired","_materialsGiven","_noLicenseCost","_text","_filter","_totalConversions","_minimumConversions"];
_vendor = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_type = [_this,3,"",[""]] call BIS_fnc_param;
//Error check
if (isNull _vendor || _type isEqualTo "" || (player distance _vendor > 10)) exitWith {};
life_action_inUse = true;//Lock out other actions during processing.
if (isClass (missionConfigFile >> "ProcessAction" >> _type)) then {
_filter = false;
_materialsRequired = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsReq");
_materialsGiven = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsGive");
_noLicenseCost = M_CONFIG(getNumber,"ProcessAction",_type,"NoLicenseCost");
_text = M_CONFIG(getText,"ProcessAction",_type,"Text");
} else {_filter = true;};
if (_filter) exitWith {life_action_inUse = false;};
_itemInfo = [_materialsRequired,_materialsGiven,_noLicenseCost,(localize format["%1",_text])];
if (count _itemInfo isEqualTo 0) exitWith {life_action_inUse = false;};
//Setup vars.
_oldItem = _itemInfo select 0;
_newItem = _itemInfo select 1;
_cost = _itemInfo select 2;
_upp = _itemInfo select 3;
_exit = false;
if (count _oldItem isEqualTo 0) exitWith {life_action_inUse = false;};
_totalConversions = [];
{
_var = ITEM_VALUE(_x select 0);
if (_var isEqualTo 0) exitWith {_exit = true;};
if (_var < (_x select 1)) exitWith {_exit = true;};
_totalConversions pushBack (floor (_var/(_x select 1)));
} forEach _oldItem;
if (_exit) exitWith {life_is_processing = false; hint localize "STR_NOTF_NotEnoughItemProcess"; life_action_inUse = false;};
if (_vendor in [mari_processor,coke_processor,heroin_processor]) then {
_hasLicense = true;
} else {
_hasLicense = LICENSE_VALUE(_type,"civ");
};
_cost = _cost * (count _oldItem);
_minimumConversions = _totalConversions call BIS_fnc_lowestNum;
_oldItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_oldItemWeight = _oldItemWeight + _weight;
} count _oldItem;
_newItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_newItemWeight = _newItemWeight + _weight;
} count _newItem;
_exit = false;
if (_newItemWeight > _oldItemWeight) then {
_netChange = _newItemWeight - _oldItemWeight;
_freeSpace = life_maxWeight - life_carryWeight;
if (_freeSpace < _netChange) exitWith {_exit = true;};
_minimumConversions = floor(_freeSpace / _netChange);
};
if (_exit) exitWith {hint localize "STR_Process_Weight"; life_is_processing = false; life_action_inUse = false;};
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
life_is_processing = true;
if (_hasLicense) then {
for "_i" from 0 to 1 step 0 do {
sleep 0.28;
_time = 0.3;
_cP = _cP + 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.4; _cpUp = 0.01; };
case 2: { _time = 0.35; _cpUp = 0.01; };
case 3: { _time = 0.3; _cpUp = 0.01; };
case 4: { _time = 0.25; _cpUp = 0.01; };
case 5: { _time = 0.2; _cpUp = 0.01; };
case 6: { _time = 0.2; _cpUp = 0.02; };
case 7: { _time = 0.2; _cpUp = 0.03; };
case 8: { _time = 0.2; _cpUp = 0.04; };
case 9: { _time = 0.15; _cpUp = 0.05; };
case 10: { _time = 0.1; _cpUp = 0.07; };
};
};
while{true} do
{
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
5 cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
life_is_processing = false; life_action_inUse = false;
} else {
if (CASH < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
for "_i" from 0 to 1 step 0 do {
sleep 0.9;
_time = 0.9;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0) do
{
case 1: { _time = 0.9; _cpUp = 0.01; };
case 2: { _time = 0.8; _cpUp = 0.01; };
case 3: { _time = 0.7; _cpUp = 0.01; };
case 4: { _time = 0.6; _cpUp = 0.01; };
case 5: { _time = 0.5; _cpUp = 0.01; };
case 6: { _time = 0.4; _cpUp = 0.01; };
case 7: { _time = 0.3; _cpUp = 0.01; };
case 8: { _time = 0.2; _cpUp = 0.01; };
case 9: { _time = 0.2; _cpUp = 0.02; };
case 10: { _time = 0.2; _cpUp = 0.03; };
};
};
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
if (CASH < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
5 cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
CASH = CASH - _cost;
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
life_is_processing = false; life_action_inUse = false;
};
Alles anzeigen
8. Ersetzt die fn_gather.sqf durch das:
#include "..\..\script_macros.hpp"
/*
File: fn_gather.sqf
Author: Devilfloh
Edit by AmaZiinG for the level system
P.S. - Don't be a faggot like i know some of you all will be.
Description:
Main functionality for gathering.
*/
private["_maxGather","_resource","_amount","_maxGather","_requiredItem"];
if (life_action_inUse) exitWith {};
while {true} do {
if ((vehicle player) != player) exitWith {};
if (life_interrupted) exitWith {life_interrupted = false;};
if (player getVariable "restrained") exitWith {hint localize "STR_NOTF_isrestrained";};
if (player getVariable "playerSurrender") exitWith {hint localize "STR_NOTF_surrender";};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_time = 0;
_profName = [_gather] call life_fnc_profType; //Level System
_zoneSize = (getNumber(missionConfigFile >> "CfgGather" >> "zoneSize"));
_exit = false;
_resourceCfg = missionConfigFile >> "CfgGather" >> "Resources";
if( _profName != "" ) then
{
_data = missionNamespace getVariable (_profName);
_time = ( 3 - (0.25 * (_data select 0)));
};
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resource = configName _curConfig;
_maxGather = getNumber(_curConfig >> "amount");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
{
if ((player distance (getMarkerPos _x)) < _zoneSize) exitWith {_zone = _x;};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {life_action_inUse = false;};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
//Messages here
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {life_action_inUse = false;};
_amount = round(random(_maxGather)) + 1;
_diff = [_resource,_amount,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
switch (_requiredItem) do {
case "pickaxe": {player say3D "mining";};
default {player say3D "harvest";};
};
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";};
sleep 0.5;
};
if ([true,_resource,_diff] call life_fnc_handleInv) then {
_itemName = M_CONFIG(getText,"VirtualItems",_resource,"displayName");
titleText[format[localize "STR_NOTF_Gather_Success",(localize _itemName),_diff],"PLAIN"];
if( _profName != "" ) then //Level System
{ //Level System
[_profName,25] call life_fnc_addExp; //Level System
};
};
[] call life_fnc_hudUpdate;
sleep 1;
};
life_action_inUse = false;
/*
replace from life_action_inuse = true down
life_action_inUse = true;
_time = 0;
_profName = [_gather] 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,_gather,_diff] call life_fnc_handleInv)) then
{
_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;
titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then
{
[_profName,25] call life_fnc_addExp;
};
};
life_action_inUse = false;
/*
Alles anzeigen
9. Ersetzt eure fn_requestRecived.sqf:
#include "..\..\script_macros.hpp"
/*
File: fn_requestReceived.sqf
Author: Bryan "Tonic" Boardwine
Edit by AmaZiinG for the level system
P.S. - Don't be a faggot like i know some of you all will be.
Description:
Called by the server saying that we have a response so let's
sort through the information, validate it and if all valid
set the client up.
*/
private["_array"];
life_session_tries = life_session_tries + 1;
if (life_session_completed) exitWith {}; //Why did this get executed when the client already initialized?
if (life_session_tries > 3) exitWith {cutText[localize "STR_Session_Error","BLACK FADED"]; 0 cutFadeOut 999999999;};
0 cutText [localize "STR_Session_Received","BLACK FADED"];
0 cutFadeOut 9999999;
//Error handling and junk..
if (isNil "_this") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (_this isEqualType "") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (count _this isEqualTo 0) exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if ((_this select 0) isEqualTo "Error") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (!(getPlayerUID player isEqualTo (_this select 0))) exitWith {[] call SOCK_fnc_dataQuery;};
//Lets make sure some vars are not set before hand.. If they are get rid of them, hopefully the engine purges past variables but meh who cares.
if (!isServer && (!isNil "life_adminlevel" || !isNil "life_coplevel" || !isNil "life_donorlevel")) exitWith {
[profileName,getPlayerUID player,"VariablesAlreadySet"] remoteExecCall ["SPY_fnc_cookieJar",RSERV];
[profileName,format["Variables set before client initialization...\nlife_adminlevel: %1\nlife_coplevel: %2\nlife_donorlevel: %3",life_adminlevel,life_coplevel,life_donorlevel]] remoteExecCall ["SPY_fnc_notifyAdmins",RCLIENT];
sleep 0.9;
failMission "SpyGlass";
};
//Parse basic player information.
CASH = parseNumber (_this select 2);
BANK = parseNumber (_this select 3);
CONST(life_adminlevel,parseNumber (_this select 4));
if (LIFE_SETTINGS(getNumber,"donor_level") isEqualTo 1) then {
CONST(life_donorlevel,parseNumber (_this select 5));
} else {
CONST(life_donorlevel,0);
};
//Loop through licenses
if (count (_this select 6) > 0) then {
{missionNamespace setVariable [(_x select 0),(_x select 1)];} forEach (_this select 6);
};
life_gear = _this select 8;
[true] call life_fnc_loadGear;
if(count (_this select 9) > 0) then {
{
missionNamespace setVariable [(_x select 0),[parseNumber (_x select 1), parseNumber (_x select 2)]];
} foreach (_this select 9);
};
//Parse side specific information.
switch (playerSide) do {
case west: {
CONST(life_coplevel, parseNumber(_this select 7));
CONST(life_medicLevel,0);
life_blacklisted = _this select 9;
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
life_hunger = ((_this select 10) select 0);
life_thirst = ((_this select 10) select 1);
player setDamage ((_this select 10) select 2);
};
};
case civilian: {
life_is_arrested = _this select 7;
CONST(life_coplevel, 0);
CONST(life_medicLevel, 0);
life_houses = _this select 13;
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
life_hunger = ((_this select 9) select 0);
life_thirst = ((_this select 9) select 1);
player setDamage ((_this select 9) select 2);
};
//Position
if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 1) then {
life_is_alive = _this select 10;
life_civ_position = _this select 11;
if (life_is_alive) then {
if (count life_civ_position != 3) then {diag_log format["[requestReceived] Bad position received. Data: %1",life_civ_position];life_is_alive =false;};
if (life_civ_position distance (getMarkerPos "respawn_civilian") < 300) then {life_is_alive = false;};
};
};
{
_house = nearestObject [(call compile format["%1",(_x select 0)]), "House"];
life_vehicles pushBack _house;
} forEach life_houses;
life_gangData = _this select 14;
if (!(count life_gangData isEqualTo 0)) then {
[] spawn life_fnc_initGang;
};
[] spawn life_fnc_initHouses;
};
case independent: {
CONST(life_medicLevel, parseNumber(_this select 7));
CONST(life_coplevel,0);
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
life_hunger = ((_this select 9) select 0);
life_thirst = ((_this select 9) select 1);
player setDamage ((_this select 9) select 2);
};
};
};
if (count (_this select 15) > 0) then {
{life_vehicles pushBack _x;} forEach (_this select 15);
};
life_session_completed = true;
Alles anzeigen
10. In der configuration.sqf sucht nach:
missionNamespace setVariable [LICENSE_VARNAME(_varName,_sideFlag),false];
} forEach ("true" configClasses (missionConfigFile >> "Licenses"));
schreibt darüber folgendes:
life_prof =
[
["Oil_Prof","civ"],
["Iron_Prof","civ"],
["Copper_Prof","civ"],
["Heroin_Prof","civ"],
["Canabis_Prof","civ"],
["Cocain_Prof","civ"],
["Salt_Prof","civ"],
["Fruit_Prof","civ"],
["Diamond_Prof","civ"],
["Rock_Prof","civ"],
["Sand_Prof","civ"]
];
Alles anzeigen
11. Die Prof.hpp einfach in den Dialog Ordner:
Prof.zip
12. Die Fn_addexp.sqf und Fn_profSetUp.sqf in den Funktion Ordner:
Fn_profSetUp.zip
13. Die Fn_profType.sqf in den core/config Ordner:
Fn_profType.zip
mh... gibt es einen Fehler oder was ist hier das Problem?
Das Problem ist das ich nicht weiß wie ich diese Codes auf die 4.4 R3 einbinde.
Alles anzeigen_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.4; _cpUp = 0.01; };
case 2: { _time = 0.35; _cpUp = 0.01; };
case 3: { _time = 0.3; _cpUp = 0.01; };
case 4: { _time = 0.25; _cpUp = 0.01; };
case 5: { _time = 0.2; _cpUp = 0.01; };
case 6: { _time = 0.2; _cpUp = 0.02; };
case 7: { _time = 0.2; _cpUp = 0.03; };
case 8: { _time = 0.2; _cpUp = 0.04; };
case 9: { _time = 0.15; _cpUp = 0.05; };
case 10: { _time = 0.1; _cpUp = 0.07; };
};
};
while{true} do
{
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {};
if(player distance _vendor > 10) exitWith {};
};
if(player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; [true,_oldItem,_oldVal] call life_fnc_handleInv; life_is_processing = false;};
5 cutText ["","PLAIN"];
titleText[format[localize "STR_Process_Processed",_oldVal,_itemName],"PLAIN"];
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
life_is_processing = false;
}
else
{
if(life_cash < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false;};
_time = 0.9;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0) do
{
case 1: { _time = 0.9; _cpUp = 0.01; };
case 2: { _time = 0.8; _cpUp = 0.01; };
case 3: { _time = 0.7; _cpUp = 0.01; };
case 4: { _time = 0.6; _cpUp = 0.01; };
case 5: { _time = 0.5; _cpUp = 0.01; };
case 6: { _time = 0.4; _cpUp = 0.01; };
case 7: { _time = 0.3; _cpUp = 0.01; };
case 8: { _time = 0.2; _cpUp = 0.01; };
case 9: { _time = 0.2; _cpUp = 0.02; };
case 10: { _time = 0.2; _cpUp = 0.03; };
};
};
Hey Leute,
ich brauche eure Hilfe, ich schreibe zur Zeit das Persistent Proficiency System um. Leider komme ich bei der fn_gather.sqf und bei der Fn_processaction.sqf nicht weiter airborne .
Hier sind mal meine 2 SQFs (die Source Codes stehen bei beiden dateien ganz unten):
#include "..\..\script_macros.hpp"
/*
File: fn_processAction.sqf
Author: Bryan "Tonic" Boardwine
Modified : NiiRoZz
Description:
Master handling for processing an item.
NiiRoZz : Added multiprocess
*/
private["_vendor","_type","_itemInfo","_oldItem","_newItemWeight","_newItem","_oldItemWeight","_cost","_upp","_hasLicense","_itemName","_oldVal","_ui","_progress","_pgText","_cP","_materialsRequired","_materialsGiven","_noLicenseCost","_text","_filter","_totalConversions","_minimumConversions"];
_vendor = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_type = [_this,3,"",[""]] call BIS_fnc_param;
//Error check
if (isNull _vendor || _type isEqualTo "" || (player distance _vendor > 10)) exitWith {};
life_action_inUse = true;//Lock out other actions during processing.
if (isClass (missionConfigFile >> "ProcessAction" >> _type)) then {
_filter = false;
_materialsRequired = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsReq");
_materialsGiven = M_CONFIG(getArray,"ProcessAction",_type,"MaterialsGive");
_noLicenseCost = M_CONFIG(getNumber,"ProcessAction",_type,"NoLicenseCost");
_text = M_CONFIG(getText,"ProcessAction",_type,"Text");
} else {_filter = true;};
if (_filter) exitWith {life_action_inUse = false;};
_itemInfo = [_materialsRequired,_materialsGiven,_noLicenseCost,(localize format["%1",_text])];
if (count _itemInfo isEqualTo 0) exitWith {life_action_inUse = false;};
//Setup vars.
_oldItem = _itemInfo select 0;
_newItem = _itemInfo select 1;
_cost = _itemInfo select 2;
_upp = _itemInfo select 3;
_exit = false;
if (count _oldItem isEqualTo 0) exitWith {life_action_inUse = false;};
_totalConversions = [];
{
_var = ITEM_VALUE(_x select 0);
if (_var isEqualTo 0) exitWith {_exit = true;};
if (_var < (_x select 1)) exitWith {_exit = true;};
_totalConversions pushBack (floor (_var/(_x select 1)));
} forEach _oldItem;
if (_exit) exitWith {life_is_processing = false; hint localize "STR_NOTF_NotEnoughItemProcess"; life_action_inUse = false;};
if (_vendor in [mari_processor,coke_processor,heroin_processor]) then {
_hasLicense = true;
} else {
_hasLicense = LICENSE_VALUE(_type,"civ");
};
_cost = _cost * (count _oldItem);
_minimumConversions = _totalConversions call BIS_fnc_lowestNum;
_oldItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_oldItemWeight = _oldItemWeight + _weight;
} count _oldItem;
_newItemWeight = 0;
{
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
_newItemWeight = _newItemWeight + _weight;
} count _newItem;
_exit = false;
if (_newItemWeight > _oldItemWeight) then {
_netChange = _newItemWeight - _oldItemWeight;
_freeSpace = life_maxWeight - life_carryWeight;
if (_freeSpace < _netChange) exitWith {_exit = true;};
_minimumConversions = floor(_freeSpace / _netChange);
};
if (_exit) exitWith {hint localize "STR_Process_Weight"; life_is_processing = false; life_action_inUse = false;};
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0.01;
life_is_processing = true;
if (_hasLicense) then {
for "_i" from 0 to 1 step 0 do {
sleep 0.28;
_cP = _cP + 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
5 cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
life_is_processing = false; life_action_inUse = false;
} else {
if (CASH < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
if( _profName != "" ) then
{
switch ( _data select 0) do
{
case 1: { _time = 0.9; _cpUp = 0.01; };
case 2: { _time = 0.8; _cpUp = 0.01; };
case 3: { _time = 0.7; _cpUp = 0.01; };
case 4: { _time = 0.6; _cpUp = 0.01; };
case 5: { _time = 0.5; _cpUp = 0.01; };
case 6: { _time = 0.4; _cpUp = 0.01; };
case 7: { _time = 0.3; _cpUp = 0.01; };
case 8: { _time = 0.2; _cpUp = 0.01; };
case 9: { _time = 0.2; _cpUp = 0.02; };
case 10: { _time = 0.2; _cpUp = 0.03; };
};
};
while{true} do
{
for "_i" from 0 to 1 step 0 do {
sleep 0.9;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if (_cP >= 1) exitWith {};
if (player distance _vendor > 10) exitWith {};
};
if (player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
if (CASH < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
{
[false,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _oldItem;
{
[true,(_x select 0),((_x select 1)*(_minimumConversions))] call life_fnc_handleInv;
} count _newItem;
5 cutText ["","PLAIN"];
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
CASH = CASH - _cost;
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
[0] call SOCK_fnc_updatePartial;
life_is_processing = false;
life_action_inUse = false;
};
[] call life_fnc_hudUpdate;
/*
///////////////////////
Source code
//////////////////////
if(_hasLicense) then
{
_time = 0.3;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.4; _cpUp = 0.01; };
case 2: { _time = 0.35; _cpUp = 0.01; };
case 3: { _time = 0.3; _cpUp = 0.01; };
case 4: { _time = 0.25; _cpUp = 0.01; };
case 5: { _time = 0.2; _cpUp = 0.01; };
case 6: { _time = 0.2; _cpUp = 0.02; };
case 7: { _time = 0.2; _cpUp = 0.03; };
case 8: { _time = 0.2; _cpUp = 0.04; };
case 9: { _time = 0.15; _cpUp = 0.05; };
case 10: { _time = 0.1; _cpUp = 0.07; };
};
};
while{true} do
{
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {};
if(player distance _vendor > 10) exitWith {};
};
if(player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; [true,_oldItem,_oldVal] call life_fnc_handleInv; life_is_processing = false;};
5 cutText ["","PLAIN"];
titleText[format[localize "STR_Process_Processed",_oldVal,_itemName],"PLAIN"];
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
life_is_processing = false;
}
else
{
if(life_cash < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false;};
_time = 0.9;
_cpUp = 0.01;
_profName = [_type] call life_fnc_profType;
_data = missionNamespace getVariable "_profName";
if( _profName != "" ) then
{
switch ( _data select 0) do
{
case 1: { _time = 0.9; _cpUp = 0.01; };
case 2: { _time = 0.8; _cpUp = 0.01; };
case 3: { _time = 0.7; _cpUp = 0.01; };
case 4: { _time = 0.6; _cpUp = 0.01; };
case 5: { _time = 0.5; _cpUp = 0.01; };
case 6: { _time = 0.4; _cpUp = 0.01; };
case 7: { _time = 0.3; _cpUp = 0.01; };
case 8: { _time = 0.2; _cpUp = 0.01; };
case 9: { _time = 0.2; _cpUp = 0.02; };
case 10: { _time = 0.2; _cpUp = 0.03; };
};
};
while{true} do
{
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {};
if(player distance _vendor > 10) exitWith {};
};
if(player distance _vendor > 10) exitWith {hint localize "STR_Process_Stay"; 5 cutText ["","PLAIN"]; life_is_processing = false;};
if(life_cash < _cost) exitWith {hint format[localize "STR_Process_License",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;};
if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; [true,_oldItem,_oldVal] call life_fnc_handleInv; life_is_processing = false;};
5 cutText ["","PLAIN"];
titleText[format[localize "STR_Process_Processed2",_oldVal,_itemName,[_cost] call life_fnc_numberText],"PLAIN"];
life_cash = life_cash - _cost;
if( _profName != "" ) then
{
[_profName,40] call life_fnc_addExp;
};
life_is_processing = false;
};
*/
Alles anzeigen
#include "..\..\script_macros.hpp"
/*
File: fn_gather.sqf
Author: Devilfloh
Description:
Main functionality for gathering.
*/
private["_maxGather","_resource","_amount","_maxGather","_requiredItem"];
if (life_action_inUse) exitWith {};
while {true} do {
if ((vehicle player) != player) exitWith {};
if (life_interrupted) exitWith {life_interrupted = false;};
if (player getVariable "restrained") exitWith {hint localize "STR_NOTF_isrestrained";};
if (player getVariable "playerSurrender") exitWith {hint localize "STR_NOTF_surrender";};
life_action_inUse = true;
_zone = "";
_requiredItem = "";
_time = 0;
_profName = [_gather] call life_fnc_profType;
_zoneSize = (getNumber(missionConfigFile >> "CfgGather" >> "zoneSize"));
_exit = false;
_resourceCfg = missionConfigFile >> "CfgGather" >> "Resources";
if( _profName != "" ) then
{
_data = missionNamespace getVariable (_profName);
_time = ( 3 - (0.25 * (_data select 0)));
};
for "_i" from 0 to count(_resourceCfg)-1 do {
_curConfig = _resourceCfg select _i;
_resource = configName _curConfig;
_maxGather = getNumber(_curConfig >> "amount");
_resourceZones = getArray(_curConfig >> "zones");
_requiredItem = getText(_curConfig >> "item");
{
if ((player distance (getMarkerPos _x)) < _zoneSize) exitWith {_zone = _x;};
} forEach _resourceZones;
if (_zone != "") exitWith {};
};
if (_zone isEqualTo "") exitWith {life_action_inUse = false;};
if (_requiredItem != "") then {
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem;
if (_valItem < 1) exitWith {
switch (_requiredItem) do {
//Messages here
};
life_action_inUse = false;
_exit = true;
};
};
if (_exit) exitWith {life_action_inUse = false;};
_amount = round(random(_maxGather)) + 1;
_diff = [_resource,_amount,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if (_diff isEqualTo 0) exitWith {
hint localize "STR_NOTF_InvFull";
life_action_inUse = false;
};
switch (_requiredItem) do {
case "pickaxe": {player say3D "mining";};
default {player say3D "harvest";};
};
for "_i" from 0 to 4 do {
player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";};
sleep 0.5;
};
if ([true,_resource,_diff] call life_fnc_handleInv) then {
_itemName = M_CONFIG(getText,"VirtualItems",_resource,"displayName");
titleText[format[localize "STR_NOTF_Gather_Success",(localize _itemName),_diff],"PLAIN"];
if( _profName != "" ) then
{
[_profName,25] call life_fnc_addExp;
};
};
[] call life_fnc_hudUpdate;
sleep 1;
};
life_action_inUse = false;
/*
replace from life_action_inuse = true down
life_action_inUse = true;
_time = 0;
_profName = [_gather] 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,_gather,_diff] call life_fnc_handleInv)) then
{
_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;
titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then
{
[_profName,25] call life_fnc_addExp;
};
};
life_action_inUse = false;
/*
Alles anzeigen
Ich hoffe jemand kann mir weiterhelfen . Wenn diese 2 SQFs funktionieren könnte ich ein TUT für die 4.4 R3 machen.
Mfg
AmaZiinG
cl3 datein easy
Ich würde behaupten in dem man in den Difficulty Settings
deathMessages = 0; macht
Das habe ich auch schon mal versucht hat leider nicht Funktioniert.
Autor: Scarso327
Hier ein TUT um die normalen Todesnachrichten von Arma 3 auszustellen:
[Tutorial]-[Alle Versionen] Schwierigkeiten von Arma³ einstellen
1. Fügt das in eure stringtable.xml ein:
<Package name="NHS">
<Key ID="STR_NHS_Died">
<Original>%1 has died from there injuries.</Original>
</Key>
<Key ID="STR_NHS_Killed">
<Original>%1 has been heavily wounded by %2!</Original>
</Key>
<Key ID="STR_NHS_Suicide">
<Original>%1 has been heavily wounded!</Original>
</Key>
<Key ID="STR_NHS_PlayerRevived">
<Original>%1 has been revived!</Original>
</Key>
</Package>
Alles anzeigen
2. Öffnet die fn_onPlayerKilled.sqf und sucht:
//Make the killer wanted
if(!isNull _killer && {_killer != _unit} && {side _killer != west} && {alive _killer}) then {
if(vehicle _killer isKindOf "LandVehicle") then {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187V"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
//Get rid of this if you don't want automatic vehicle license removal.
if(!local _killer) then {
[2] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
} else {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
if(!local _killer) then {
[3] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
};
};
Alles anzeigen
ersetzt es durch dies:
//Make the killer wanted
if(!isNull _killer && {_killer != _unit} && {side _killer != west} && {alive _killer}) then {
if(vehicle _killer isKindOf "LandVehicle") then {
if(life_HC_isActive) then {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187V"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187V"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
//Get rid of this if you don't want automatic vehicle license removal.
if(!local _killer) then {
[2] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
} else {
if(life_HC_isActive) then {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID _killer,_killer GVAR ["realname",name _killer],"187"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
if(!local _killer) then {
[3] remoteExecCall ["life_fnc_removeLicenses",_killer];
};
};
[0,"STR_NHS_Killed",true,[profileName,_killer GVAR ["realname",name _killer]]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
} else {
if(side _killer == west && playerSide != west) then {
[0,"STR_NHS_Killed",true,[profileName,_killer GVAR ["realname",name _killer]]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
} else {
[0,"STR_NHS_Suicide",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
};
};
Alles anzeigen
3. Öffnet eure fn_respawned.sqf und fügt über
folgendes ein:
Bilder:
Fertig !