Cheers,
Da mich 1000 Leute über PN angeschrieben haben - veröffentliche ich das Tutorial für das einfügen der Opfor Fraktion für das Framework 5.0.
Script: Einfügen der 4ten Fraktion
Version : Altis Life 5.0
Schwierigkeitsgrad: Fortgeschrittene
Ich untersage hiermit das das verbreiten in anderen Forum untersagt ist - es gibt ja hier spezielle Kanditen die das mal gerne tun.
Anleitung:
(Modedit) dieser Link führt euch zum weiterführenden Teil dieses Tutorials [klick mich]. Erst NACH dem Tutorial machen.
Öffnet eure Config_Master.hpp und fügt ein:
Öffnet eure core/init.sqf und fügt ein :
//Set bank amount for new players
case east: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_adac");
};
case east: {
//Initialize Adac and blah
_handle = [] spawn life_fnc_initAdac;
waitUntil {scriptDone _handle};
};
Öffnet eure /core/shops/fn_atmMenu.sqf
Öffnet eure /core/session/fn_updateRequest.sqf
_flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};
Öffnet eure /core/session/fn_requestReceived.sqf
case east: {
CONST(life_adacLevel,(_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);
};
};
Öffnet eure /core/session/fn_updatePartial.sqf
_flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};
Öffnet eure /core/medical/fn_respawned.sqf
Öffnet eure /Functions.hpp
Unter : class Master_Directory { file = "core";
das hier einfügen: class initAdac {};
Und sowohl als auch das in die gleiche Class einfügen :
Öffnet eure /dialog/function/fn_spawnPointCfg.sqf
Öffnet eure /Config_SpawnPoints.hpp
class adac {
class Kavala {
displayName = "Adac HQ";
spawnMarker = "adac_spawn_1";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
Öffnet eure /core/pmenu/fn_p_updateMenu.sqf
_side = switch (playerSide) do {case west:{"cop"}; case civilian:{"civ"}; case independent:{"med"};case east:{"adac"};};
Öffnet eure /core/functions/fn_playerSkins.sqf
case east: {
if (uniform player isEqualTo "U_Rangemaster") then {
player setObjectTextureGlobal [0, "textures\medic_uniform.jpg"];
};
};
Öffnet eure /core/pmenu/fn_cellphone.sqf
Erstellt eine Datei : /core/fn_initAdac.sqf
#include "..\script_macros.hpp"
/*
File: fn_initAdac.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initializes the adac..
*/
private["_end"];
player addRating 99999999;
waitUntil {!(isNull (findDisplay 46))};
//Hier wird geblacklisted
if ((FETCH_CONST(life_adacLevel)) < 1 && (FETCH_CONST(life_adminlevel) isEqualTo 0)) exitWith {
["Notwhitelisted",FALSE,TRUE] call BIS_fnc_endMission;
sleep 35;
};
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
Alles anzeigen
Erstellt einen Ordner : /core/adac
Erstellt die Datei fn_adacLoadout.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_adacLoadout.sqf
Author: Bryan "Tonic" Boardwine
Edited by: Kuchenplatte
Description:
Loads the medic out with the default gear.
*/
private ["_handle"];
_handle = [] spawn life_fnc_stripDownPlayer;
waitUntil {scriptDone _handle};
player addUniform "U_Rangemaster";
player addItem "FirstAidKit";
player addItem "Toolkit";
player linkItem "ItemMap";
player linkItem "ItemCompass";
player linkItem "ItemWatch";
[] call life_fnc_playerSkins;
[] call life_fnc_saveGear;
Alles anzeigen
Erstellt die Datei : fn_adacMarkers.sqf
/*
File: fn_adacMarkers.sqf
Author: -
Description:
Marks adac on the map for other adac. Only initializes when the actual map is open.
*/
private["_markers","_adac"];
_markers = [];
_adac = [];
sleep 0.5;
if(visibleMap) then {
{if(side _x == east) then {_adac pushBack _x;}} foreach playableUnits; //Fetch list of adac / opfor
//Create markers
{
if(_x != player) then {
_marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x];
_marker setMarkerColorLocal "ColorOPFOR";
_marker setMarkerTypeLocal "Mil_dot";
_marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]];
_markers pushBack [_marker,_x];
};
} foreach _adac;
while {visibleMap} do {
{
private["_marker","_unit"];
_marker = _x select 0;
_unit = _x select 1;
if(!isNil "_unit" && !isNull _unit) then {
_marker setMarkerPosLocal (visiblePosition _unit);
};
} foreach _markers;
if(!visibleMap) exitWith {};
sleep 0.02;
};
{deleteMarkerLocal (_x select 0);} foreach _markers;
_markers = [];
_adac = [];
};
Alles anzeigen
====================================================================================================
@Life_Server
Öffnet eure /@life_server/addons/life_server/init.sqf
Öffnet eure /Functions/MYSQL/fn_insertRequest.sqf
//Prepare the query statement..
_query = format ["INSERT INTO players (pid, name, cash, bankacc, aliases, cop_licenses, med_licenses, civ_licenses, civ_gear, cop_gear, med_gear, adac_gear, adac_licenses) VALUES('%1', '%2', '%3', '%4', '%5','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""')",
_uid,
_name,
_money,
_bank,
_alias
];
Öffnet eure /Functions/MYSQL/fn_queryRequest.sqf
//East
case east: {format["SELECT pid, name, cash, bankacc, adminlevel, donorlevel, adac_licenses, adaclevel, adac_gear, adac_stats, playtime FROM players WHERE pid='%1'",_uid];};
case east: {
//Pa* * e 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;
};
Alles anzeigen
Öffnet eure /Functions/MYSQL/fn_updateRequest.sqf
case east: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', adac_licenses='%4', adac_gear='%5', adac_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_licenses,_gear,_stats,_playtime_update,_uid];};
Öffnet eure /Functions/MYSQL/fn_updatePartial.sqf
case east: {_query = format["UPDATE players SET adac_licenses='%1' WHERE pid='%2'",_value,_uid];};
Öffnet eure /Functions/Systems/fn_getVehicles.sqf
Öffnet eure /Functions/Systems/fn_vehicleCreate.sqf
Öffnet eure /Functions/Systems/fn_spawn_Vehicle.sqf
if ((_vInfo select 1) isEqualTo "adac" && (_vInfo select 2) isEqualTo "C_Offroad_01_F") then {
[_vehicle,"adac_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit];
};
=================================
Mission.sqm
Spawn : adac_spawn_1
Variable: "adac_1" und Beschreibung "ADAC Whithlist 1"
MYSQL
ALTER TABLE `players` ADD (`adac_licenses` TEXT NOT NULL);
ALTER TABLE `players` ADD (`adac_gear` TEXT NOT NULL);
ALTER TABLE `players` ADD (`adaclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0');
ALTER TABLE `players` ADD (`adac_stats` VARCHAR(32) NOT NULL DEFAULT '"[100,100,0]"');
Best Regards
Kuchenplatte