Advertisement
Guest User

Tutorial for OPFOR from altisdev.com

a guest
May 27th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.26 KB | None | 0 0
  1. Leepo S
  2. Membre
  3.  
  4. Membre
  5.  
  6. 36 messages
  7. LocationIsland Dream
  8. @Mention
  9. Posté 22 mai 2015 - 17h12
  10. Salut,
  11.  
  12. Bon, je vais vous expliquer, ou plutôt convertir un script version 3.1.4.8 en 4.0 concernant l'ajout des Opfor sur Altis, ce qui n'est pas compliqué.
  13. ( Je précise que c'est la 4.0 de Itsyuka et non de TONIC, évitez de faire du copier coller, essayer de comprendre, et surtout suivre)
  14.  
  15.  
  16.  
  17. Dans votre dossier @extDB/extDB/db_custom > altis-life-rpg-4
  18. (HORS MISSION, HORS LIFE SERVER)
  19. Modification :
  20. [playerInfoInsert]
  21. ;;
  22.  
  23. SQL1_1 = INSERT INTO players
  24. ;; 1 2 3 4 5 6 7 8 9 10 11 12 13
  25. SQL1_2 = (playerid, name, cash, bankacc, aliases, cop_licenses, med_licenses, adac_licenses, civ_licenses, civ_gear, cop_gear, med_gear, adac_gear)
  26. SQL1_3 = VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?);
  27.  
  28. SQL1_INPUTS = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
  29.  
  30. Number of Inputs = 13
  31.  
  32. ;;______________________________________________________________
  33. A rajouter :
  34. [playerEastInfo]
  35. ;;
  36. 1 2 3 4 5 6 7 8 9
  37. SQL1_1 = SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, adac_licenses, adaclevel, adac_gear FROM players WHERE playerid=?;
  38. SQL1_INPUTS = 1
  39.  
  40. Number of Inputs = 1
  41. OUTPUT = 1-String, 2-String, 3, 4, 5-String, 6-String, 7-AltisLifeRPG_Array, 8-String, 9-AltisLifeRPG_Array
  42.  
  43. ;;______________________________________________________________
  44. [playerUpdateAdacLicense]
  45. ;;
  46.  
  47. SQL1_1 = UPDATE players
  48. SQL1_2 = SET adac_licenses=? WHERE playerid=?;
  49.  
  50. SQL1_INPUTS = 1-AltisLifeRPG_Array, 2
  51. Number of Inputs = 2
  52.  
  53. ;;______________________________________________________________
  54. [playerUpdateAdacGear]
  55. ;;
  56.  
  57. SQL1_1 = UPDATE players
  58. SQL1_2 = SET adac_gear=? WHERE playerid=?;
  59.  
  60. SQL1_INPUTS = 1-AltisLifeRPG_Array, 2
  61. Number of Inputs = 2
  62.  
  63. ;;______________________________________________________________
  64. [playerAdacUpdate]
  65. ;;
  66.  
  67. SQL1_1 = UPDATE players
  68. ;; 1 2 3 4 5 6
  69. SQL1_2 = SET name=?, cash=?, bankacc=?, adac_licenses=?, adac_gear=? WHERE playerid=?;
  70.  
  71. SQL1_INPUTS = 1, 2, 3, 4-AltisLifeRPG_Array, 5-AltisLifeRPG_Array, 6
  72.  
  73. Number of Inputs = 6
  74.  
  75. ;;______________________________________________________________
  76. Dans votre base de donnée, Faites une requête SQL dans votre Table Player
  77. ALTER TABLE `players` ADD (
  78. `adac_licenses` TEXT NULL DEFAULT NULL
  79. );
  80.  
  81. ALTER TABLE `players` ADD (
  82. `adac_gear` TEXT NOT NULL
  83. );
  84.  
  85. ALTER TABLE `players` ADD (
  86. `adaclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0'
  87. );
  88. Ce qui va rajouter 3 colonnes, adac_licenses, adac_gear, adaclevel.
  89.  
  90.  
  91. MISSION : Créer un Dossier adac dans votre dossier Core
  92.  
  93. Dans ce dossier nous allons créer 3 Fichiers
  94.  
  95. fn_adacLoadout.sqf
  96. /*
  97. File: fn_adacLoadout.sqf
  98. Author: Bryan "Tonic" Boardwine
  99. Edited: Itsyuka
  100.  
  101. Description:
  102. Loads the ADAC out with the default gear.
  103. */
  104.  
  105. private["_handle"];
  106. _handle = [] spawn life_fnc_stripDownPlayer;
  107. waitUntil {scriptDone _handle};
  108.  
  109. //Load player with default adac gear.
  110. player addUniform "U_Rangemaster";
  111.  
  112. /* ITEMS */
  113. player addItem "ItemMap";
  114. player assignItem "ItemMap";
  115. player addItem "ItemCompass";
  116. player assignItem "ItemCompass";
  117. player addItem "ItemWatch";
  118. player assignItem "ItemWatch";
  119. player addItem "ItemGPS";
  120. player assignItem "ItemGPS";
  121. player addItem "ItemRadio";
  122. player assignItem "ItemRadio";
  123.  
  124. [] call life_fnc_saveGear;
  125. fn_adacVInteractionMenu.sqf
  126. #include <macro.h>
  127. /*
  128. File: fn_copInteractionMenu.sqf
  129. Author: Bryan "Tonic" Boardwine
  130.  
  131. Description:
  132. Replaces the mass addactions for various cop actions towards another player.
  133. */
  134. #define Btn1 37450
  135. #define Btn2 37451
  136. #define Btn3 37452
  137. #define Btn4 37453
  138. #define Btn5 37454
  139. #define Btn6 37455
  140. #define Btn7 37456
  141. #define Btn8 37457
  142. #define Title 37401
  143.  
  144. private["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7"];
  145. if(!dialog) then {
  146. createDialog "pInteraction_Menu";
  147. };
  148. disableSerialization;
  149. _curTarget = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  150. if(isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
  151.  
  152. if(_curTarget isKindOf "House_F") exitWith {
  153. if((nearestObject [[16019.5,16952.9,0],"Land_Dome_Big_F"]) == _curTarget OR (nearestObject [[16019.5,16952.9,0],"Land_Research_house_V1_F"]) == _curTarget) then {
  154. _display = findDisplay 37400;
  155. _Btn1 = _display displayCtrl Btn1;
  156. _Btn2 = _display displayCtrl Btn2;
  157. _Btn3 = _display displayCtrl Btn3;
  158. _Btn4 = _display displayCtrl Btn4;
  159. _Btn5 = _display displayCtrl Btn5;
  160. _Btn6 = _display displayCtrl Btn6;
  161. _Btn7 = _display displayCtrl Btn7;
  162. life_pInact_curTarget = _curTarget;
  163.  
  164. _Btn1 ctrlSetText localize "STR_pInAct_Repair";
  165. _Btn1 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_repairDoor;";
  166.  
  167. _Btn2 ctrlSetText localize "STR_pInAct_CloseOpen";
  168. _Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_doorAnimate;";
  169. _Btn3 ctrlShow false;
  170. _Btn4 ctrlShow false;
  171. _Btn5 ctrlShow false;
  172. _Btn6 ctrlShow false;
  173. _Btn7 ctrlShow false;
  174. } else {
  175. closeDialog 0;
  176. };
  177. };
  178.  
  179. if(!isPlayer _curTarget && side _curTarget == civilian) exitWith {closeDialog 0;}; //Bad side check?
  180. _display = findDisplay 37400;
  181. _Btn1 = _display displayCtrl Btn1;
  182. _Btn2 = _display displayCtrl Btn2;
  183. _Btn3 = _display displayCtrl Btn3;
  184. _Btn4 = _display displayCtrl Btn4;
  185. _Btn5 = _display displayCtrl Btn5;
  186. _Btn6 = _display displayCtrl Btn6;
  187. _Btn7 = _display displayCtrl Btn7;
  188. life_pInact_curTarget = _curTarget;
  189.  
  190. //Set Unrestrain Button
  191. _Btn1 ctrlSetText localize "STR_pInAct_Unrestrain";
  192. _Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_unrestrain; closeDialog 0;";
  193.  
  194. //Set Search Button
  195. _Btn2 ctrlSetText localize "STR_pInAct_SearchPlayer";
  196. _Btn2 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_searchAction; closeDialog 0;";
  197.  
  198. //Set Escort Button
  199. if((_curTarget getVariable["Escorting",false])) then {
  200. _Btn3 ctrlSetText localize "STR_pInAct_StopEscort";
  201. _Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_stopEscorting; [life_pInact_curTarget] call life_fnc_copInteractionMenu;";
  202. } else {
  203. _Btn3 ctrlSetText localize "STR_pInAct_Escort";
  204. _Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
  205. };
  206.  
  207. _Btn4 ctrlSetText localize "STR_pInAct_PutInCar";
  208. _Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar;";
  209. fn_restrain.sqf
  210. #include <macro.h>
  211. /*
  212. File: fn_restrain.sqf
  213. Author: Bryan "Tonic" Boardwine
  214.  
  215. Description:
  216. Retrains the client.
  217. */
  218. private["_adac","_player"];
  219. _adac = [_this,0,Objnull,[Objnull]] call BIS_fnc_param;
  220. _player = player;
  221. if(isNull _adac) exitWith {};
  222.  
  223. //Monitor excessive restrainment
  224. [] spawn {
  225. private "_time";
  226. while {true} do {
  227. _time = time;
  228. waitUntil {(time - _time) > (5 * 60)};
  229.  
  230. if(!(player GVAR ["restrained",FALSE])) exitWith {};
  231. if(!([east,getPos player,30] call life_fnc_nearUnits) && (player GVAR ["restrained",FALSE]) && vehicle player == player) exitWith {
  232. player SVAR ["restrained",FALSE,TRUE];
  233. player SVAR ["Escorting",FALSE,TRUE];
  234. player SVAR ["transporting",false,true];
  235. detach player;
  236. titleText[localize "STR_Cop_ExcessiveRestrain","PLAIN"];
  237. };
  238. };
  239. };
  240.  
  241. if((player GVAR["surrender",FALSE])) then { player SVAR["surrender",FALSE,TRUE]; player switchMove ""; };
  242.  
  243. titleText[format[localize "STR_Cop_Retrained",_adac GVAR ["realname",name _adac]],"PLAIN"];
  244.  
  245. while {player GVAR "restrained"} do {
  246. if(vehicle player == player) then {
  247. player playMove "AmovPercMstpSnonWnonDnon_Ease";
  248. };
  249.  
  250. _state = vehicle player;
  251. waitUntil {animationState player != "AmovPercMstpSnonWnonDnon_Ease" || !(player GVAR "restrained") || vehicle player != _state};
  252.  
  253. if(!alive player) exitWith {
  254. player SVAR ["restrained",false,true];
  255. player SVAR ["Escorting",false,true];
  256. player SVAR ["transporting",false,true];
  257. detach _player;
  258. };
  259.  
  260. if(!alive _adac) exitWith {
  261. player SVAR ["Escorting",false,true];
  262. detach player;
  263. };
  264.  
  265. if(vehicle player != player) then {
  266. //disableUserInput true;
  267. if(driver (vehicle player) == player) then {player action["eject",vehicle player];};
  268. };
  269. };
  270.  
  271. //disableUserInput false;
  272.  
  273. if(alive player) then {
  274. player switchMove "AmovPercMstpSlowWrflDnon_SaluteIn";
  275. player SVAR ["Escorting",false,true];
  276. player SVAR ["transporting",false,true];
  277. detach player;
  278. };
  279. Informations: n'oubliez pas d'insérer le fichier macro.h ( si vous comprenez pas voici ci dessous )
  280.  
  281. macro.h
  282. #define SYSTEM_TAG "life"
  283. #define ITEM_TAG format["%1%2",SYSTEM_TAG,"item_"]
  284. #define SUB(var1,var2) var1 = var1 - var2
  285. #define ADD(var1,var2) var1 = var1 + var2
  286. #define SEL(ARRAY,INDEX) (ARRAY select INDEX)
  287. #define CASH life_cash
  288. #define BANK life_atmbank
  289. #define GANG_FUNDS grpPlayer getVariable ["gang_bank",0];
  290.  
  291. //Namespace Macros
  292. #define SVAR_MNS missionNamespace setVariable
  293. #define SVAR_UINS uiNamespace setVariable
  294. #define SVAR_PNS parsingNamespace setVariable
  295. #define GVAR_MNS missionNamespace getVariable
  296. #define GVAR_UINS uiNamespace getVariable
  297.  
  298. //Scripting Macros
  299. #define CONST(var1,var2) var1 = compileFinal (if(typeName var2 == "STRING") then {var2} else {str(var2)})
  300. #define CONSTVAR(var) var = compileFinal (if(typeName var == "STRING") then {var} else {str(var)})
  301. #define FETCH_CONST(var) (call var)
  302. #define PVAR_ALL(var) publicVariable var
  303. #define PVAR_SERV(var) publicVariableServer var
  304. #define PVAR_ID(var,id) id publicVariableClient var
  305. #define GVAR getVariable
  306. #define SVAR setVariable
  307. #define RIFLE primaryWeapon player
  308. #define RIFLE_ITEMS primaryWeaponItems player
  309. #define PISTOL handgunWeapon player
  310. #define PISTOL_ITEMS handgunItems player
  311. #define LAUNCHER secondaryWeapon player
  312. #define EXTDB_FAILED(MESSAGE) \
  313. life_server_extDB_notLoaded = [true,##MESSAGE]; \
  314. PVAR_ALL("life_server_extDB_notLoaded"); \
  315. diag_log MESSAGE;
  316.  
  317. //Display Macros
  318. #define CONTROL(disp,ctrl) ((findDisplay ##disp) displayCtrl ##ctrl)
  319. #define CONTROL_DATA(ctrl) (lbData[ctrl,lbCurSel ctrl])
  320. #define CONTROL_DATAI(ctrl,index) ctrl lbData index
  321.  
  322. //System Macros
  323. #define grpPlayer group player
  324. #define steamid getPlayerUID player
  325. #define LICENSE_VARNAME(varName,flag) format["license_%1_%2",flag,M_CONFIG(getText,"Licenses",varName,"variable")]
  326. #define LICENSE_VALUE(varName,flag) GVAR_MNS [LICENSE_VARNAME(varName,flag),false]
  327. #define ITEM_VARNAME(varName) format["life_inv_%1",M_CONFIG(getText,"VirtualItems",varName,"variable")]
  328. #define ITEM_VALUE(varName) GVAR_MNS [ITEM_VARNAME(varName),0]
  329. #define ITEM_ILLEGAL(varName) M_CONFIG(getNumber,"VirtualItems",varName,"illegal")
  330. #define ITEM_SELLPRICE(varName) M_CONFIG(getNumber,"VirtualItems",varName,"sellPrice")
  331. #define ITEM_BUYPRICE(varName) M_CONFIG(getNumber,"VirtualItems",varName,"buyPrice")
  332. #define ITEM_NAME(varName) M_CONFIG(getText,"VirtualItems",varName,"displayName")
  333.  
  334. //Condition Macros
  335. #define EQUAL(condition1,condition2) condition1 isEqualTo condition2
  336. #define KINDOF_ARRAY(a,b) [##a,##b] call {_veh = _this select 0;_types = _this select 1;_res = false; {if (_veh isKindOf _x) exitwith { _res = true };} forEach _types;_res}
  337.  
  338. //Config Macros
  339. #define FETCH_CONFIG(TYPE,CFG,SECTION,CLASS,ENTRY) TYPE(configFile >> CFG >> SECTION >> CLASS >> ENTRY)
  340. #define FETCH_CONFIG2(TYPE,CFG,CLASS,ENTRY) TYPE(configFile >> CFG >> CLASS >> ENTRY)
  341. #define FETCH_CONFIG3(TYPE,CFG,SECTION,CLASS,ENTRY,SUB) TYPE(configFile >> CFG >> SECTION >> CLASS >> ENTRY >> SUB)
  342. #define FETCH_CONFIG4(TYPE,CFG,SECTION,CLASS,ENTRY,SUB,SUB2) TYPE(configFile >> CFG >> SECTION >> CLASS >> ENTRY >> SUB >> SUB2)
  343. #define M_CONFIG(TYPE,CFG,CLASS,ENTRY) TYPE(missionConfigFile >> CFG >> CLASS >> ENTRY)
  344. #define BASE_CONFIG(CFG,CLASS) inheritsFrom(configFile >> CFG >> CLASS)
  345. #define LIFE_SETTINGS(TYPE,SETTING) TYPE(missionConfigFile >> "Life_Settings" >> SETTING)
  346. #define CONFIG_VEHICLES "CfgVehicles"
  347. #define CONFIG_WEAPONS "CfgWeapons"
  348. #define CONFIG_MAGAZINES "CfgMagazines"
  349. #define CONFIG_GLASSES "CfgGlasses"
  350. Dans votre dossier Core, nous allons créer fn_initAdac.sqf qui sera avec nos amis les initcop, initmedic etc...
  351. #include <macro.h>
  352. /*
  353. File: fn_initAdac.sqf
  354. Author: Bryan "Tonic" Boardwine
  355.  
  356. Description:
  357. Initializes the PMC
  358. */
  359. private["_end"];
  360. player addRating 99999999;
  361. waitUntil {!(isNull (findDisplay 46))};
  362.  
  363. if((FETCH_CONST(life_adacLevel)) < 1) exitWith {
  364. ["Notwhitelisted",FALSE,TRUE] call BIS_fnc_endMission;
  365. sleep 35;
  366. };
  367.  
  368. [] call life_fnc_spawnMenu;
  369. waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
  370. waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
  371. Allez dans votre fichier functions.h
  372. class Master_Directory
  373. {
  374. file = "core";
  375. class setupActions {};
  376. class setupEVH {};
  377. class initCiv {};
  378. class initCop {};
  379. class initMedic {};
  380. class initAdac {}; //Ajout
  381. class welcomeNotification {};
  382. };
  383. Et créer une nouvelle Class
  384. class Adac
  385. {
  386. file = "core\adac";
  387. class adacLoadout {};
  388. class adacVInteractionMenu {};
  389. class restrain {};
  390. };
  391. Maintenant nous allons faire quelques rajouts de fichier déjà existant : ( suivez bien )
  392.  
  393. fn_keyHandler.sqf
  394. if(_shift && playerSide == east && !isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == civilian) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget GVAR "Escorting") && !(cursorTarget GVAR "restrained") && speed cursorTarget < 1) then
  395. {
  396. [] call life_fnc_restrainAction;
  397. };
  398. Comme ceci :
  399.  
  400. //Restraining or robbing (Shift + R)
  401. case 19:
  402. {
  403. if(_shift) then {_handled = true;};
  404. if(_shift && playerSide == west && !isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == civilian) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget GVAR "Escorting") && !(cursorTarget GVAR "restrained") && speed cursorTarget < 1) then
  405. {
  406. [] call life_fnc_restrainAction;
  407. };
  408.  
  409. if(_shift && playerSide == east && !isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == civilian) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget GVAR "Escorting") && !(cursorTarget GVAR "restrained") && speed cursorTarget < 1) then
  410. {
  411. [] call life_fnc_restrainAction;
  412. };
  413.  
  414. //Robbing
  415. if(_shift && playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" && isPlayer cursorTarget && alive cursorTarget && cursorTarget distance player < 4 && speed cursorTarget < 1) then
  416. {
  417. if((animationState cursorTarget) != "Incapacitated" && (currentWeapon player == RIFLE OR currentWeapon player == PISTOL) && currentWeapon player != "" && !life_knockout && !(player GVAR["restrained",false]) && !life_istazed && !(player GVAR["surrender",false])) then
  418. {
  419. [cursorTarget] spawn life_fnc_knockoutAction;
  420. };
  421. _handled = true;
  422. };
  423. };
  424.  
  425. Dans votre dossier core/ init.sqf
  426.  
  427. Rajouter :
  428. case east:
  429. {
  430. //Initialize ADAC
  431. _handle = [] spawn life_fnc_initAdac;
  432. waitUntil {scriptDone _handle};
  433. };
  434. En dessous des autres copains. Voir ci dessous
  435. switch (playerSide) do {
  436. case west: {
  437. _handle = [] spawn life_fnc_initCop;
  438. waitUntil {scriptDone _handle};
  439. };
  440. case civilian: {
  441. //Initialize Civilian Settings
  442. _handle = [] spawn life_fnc_initCiv;
  443. waitUntil {scriptDone _handle};
  444. };
  445. case independent: {
  446. //Initialize Medics and blah
  447. _handle = [] spawn life_fnc_initMedic;
  448. waitUntil {scriptDone _handle};
  449. };
  450. case east:
  451. {
  452. //Initialize ADAC
  453. _handle = [] spawn life_fnc_initAdac;
  454. waitUntil {scriptDone _handle};
  455. };
  456. };
  457. Dans votre dossier functions\fn_loadGear.sqf
  458.  
  459. Rajouter
  460. case east: {
  461. [] call life_fnc_adacLoadout;
  462. };
  463. Dans votre dossier functions\fn_safeGear.sqf
  464. Ligne 20 à remplacer
  465. if(playerSide == west || playerSide == civilian || playerSide == east && {EQUAL(LIFE_SETTINGS(getNumber,"save_civ_weapons"),1)}) then {
  466. Dans votre dossier core/Configuration.sqf
  467. (à vous de définir ce que vous souhaitez comme argent de départ et le salaire )
  468. case east:
  469. {
  470. life_atmcash = 50000; //Starting Bank Money
  471. life_paycheck = 5000; //Paycheck Amount
  472. };
  473. Dans votre dossier shops\fn_atmMenu.sqf
  474. case east: {_type = "Adac"};
  475. Dans votre dossier pmenu\fn_cellphone.sqf
  476. ( si vous utiliser le smarphone extdb vous ouvrez smartphone.sqf c'est la même chose )
  477. case east: {_type = "Adac"};
  478. Dans votre dossier medical\fn_respawned.sqf
  479. case east: {
  480. _handle = [] spawn life_fnc_adacLoadout;
  481. };
  482. Dans votre fichier description.ext qui se trouve dans la racine de votre mission.
  483. Rajoutez
  484. class AdacMessage
  485. {
  486. title = "ADAC Message";
  487. iconPicture = "icons\messagenew.paa";
  488. description = "%1";
  489. duration = 10;
  490. priority = 5;
  491. };
  492. Dans votre fichier Dialog\cell_phone.hpp
  493. Créer votre boutton Adc Request
  494. class AdacRequest : life_RscButtonMenu
  495. {
  496. idc = 3023;
  497. text = "$STR_CELL_AdacRequest";
  498. 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};
  499. onButtonClick = "[] call TON_fnc_cell_adacrequest";
  500.  
  501. x = 0.32;
  502. y = 0.45;
  503. w = 0.2;
  504. h = (1 / 25);
  505. };
  506. Dans votre fichier stringable.xml qui se trouve dans la racine de votre mission.
  507. Rajoutez dans la bonne section "STR_CELL_...."
  508. <Key ID="STR_CELL_AdacRequest">
  509. <Original>Requête Adac</Original>
  510. </Key>
  511. Dans votre dossier dialog\function\fn_spawnPointCfg.sqf
  512. Rajoutez un point de spawn pour vos Opfor
  513. case east:
  514. {
  515. _return = [
  516. ["adac_spawn1","ADAC Base","\a3\ui_f\data\map\MapControl\watertower_ca.paa"]
  517. ];
  518. };
  519. Ce qui veut dire quoi ? Qu'il faudra créer un marqueur sur votre map qui s'appellera "adac_spawn1"
  520.  
  521. Dans votre dossier core\session\fn_updateRequest.sqf
  522. Ligne 9
  523. _flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};
  524. Dans votre dossier core\session\fn_updatePartial.sqf
  525. Ligne 14
  526. _flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};
  527. Dans votre dossier core\session\fn_requestReceived.sqf
  528. Ligne 49
  529. //Parse side specific information.
  530. switch(playerSide) do {
  531. case west: {
  532. CONST(life_coplevel, parseNumber(SEL(_this,7)));
  533. CONST(life_medicLevel,0);
  534. CONST(life_adaclevel,0);
  535. life_blacklisted = SEL(_this,9);
  536. };
  537.  
  538. case civilian: {
  539. life_is_arrested = SEL(_this,7);
  540. CONST(life_coplevel, 0);
  541. CONST(life_medicLevel, 0);
  542. CONST(life_adaclevel,0);
  543. life_houses = SEL(_this,9);
  544. {
  545. _house = nearestBuilding (call compile format["%1", SEL(_x,0)]);
  546. life_vehicles pushBack _house;
  547. } foreach life_houses;
  548.  
  549. life_gangData = SEL(_this,10);
  550. if(!(EQUAL(count life_gangData,0))) then {
  551. [] spawn life_fnc_initGang;
  552. };
  553. [] spawn life_fnc_initHouses;
  554. };
  555.  
  556. case independent: {
  557. CONST(life_medicLevel, parseNumber(SEL(_this,7)));
  558. CONST(life_coplevel,0);
  559. CONST(life_adaclevel,0);
  560. };
  561.  
  562. case east: {
  563. CONST(life_adaclevel, parseNumber(SEL(_this,7)));
  564. CONST(life_coplevel,0);
  565. CONST(life_medicLevel,0);
  566. };
  567. };
  568. Dans votre dossier core\pmenu\ fn_p_openMenu.sqf
  569. case east:
  570. {
  571. ctrlShow[2011,false];
  572. };
  573. fn_p_udpdateMenu.sqf
  574. case east:{"adac"};
  575. Maintenant nous allons passer du coté Life Server.
  576.  
  577. Dans votre init.sqf
  578. Après la ligne 137, rajoutez
  579. life_adaclevel = 0;
  580. Après la ligne 144, rajoutez
  581. life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
  582. Dans functions.sqf
  583. Ligne 197 environs
  584. //To ADAC
  585. TON_fnc_cell_adacrequest =
  586. compileFinal "
  587. private[""_msg"",""_to""];
  588. ctrlShow[3023,false];
  589. _msg = ctrlText 3003;
  590. _to = ""ADAC Units"";
  591. if(_msg == """") exitWith {hint ""You must enter a Message!"";ctrlShow[3023,true];};
  592.  
  593. [[_msg,name player,6],""TON_fnc_clientMessage"",east,false] spawn life_fnc_MP;
  594. [] call life_fnc_cellphone;
  595. hint format[""You have sent a message to all ADAC Units."",_to,_msg];
  596. ctrlShow[3023,true];
  597. ";
  598. Plus bas
  599. publicVariable "TON_fnc_cell_adacrequest";
  600. Plus bas
  601. Rajoutez la case 6.
  602. case 6: {
  603. private[""_message""];
  604. _message = format[""!!!ADAC REQUEST: %1"",_msg];
  605. hint parseText format [""<t color='#FFCC00'><t size='2'><t align='center'>ADAC Request<br/><br/><t color='#33CC33'><t align='left'><t size='1'>To: <t color='#ffffff'>You<br/><t color='#33CC33'>From: <t color='#ffffff'>%1<br/><br/><t color='#33CC33'>Message:<br/><t color='#ffffff'>%2"",_from,_msg];
  606.  
  607. [""TextMessage"",[format[""ADAC Request from %1"",_from]]] call bis_fnc_showNotification;
  608. };
  609. Maintenant vous allez aller dans votre dossier Functions\MySQL\fn_inserRequest.sqf
  610. Ligne 46 Replacez tous.
  611. //Prepare the query statement..
  612. _query = format["playerInfoInsert:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13",
  613. _uid,
  614. _name,
  615. _money,
  616. _bank,
  617. _alias,
  618. [], // Cop Licenses
  619. [], // Med Licenses
  620. [], // Adac Licenses
  621. [], // Civ Licenses
  622. [], // Civ Gear
  623. [], // Cop Gear
  624. [], // Med Gear
  625. [] // Adac Gear
  626. ];
  627. Dans votre dossier Functions\MySQL\fn_queryRequest.sqf
  628. En dessous des copains ligne 29
  629. case east: {_returnCount = 9; format["playerEastInfo:%1",_uid];};
  630. };
  631. Dans votre dossier Functions\MySQL\fn_updatePartial.sqf
  632.  
  633. Dans case 2
  634. case east: {_query = format["playerUpdateAdacLicense:%1:%2",_value,_uid];};
  635. Dans case 3
  636. case east: {_query = format["playerUpdateAdacGear:%1:%2",_value,_uid];};
  637. Dans votre dossier Functions\MySQL\fn_updateRequest.sqf
  638. En dessous de la ligne 33
  639. case east: {_query = format["playerAdacUpdate:%1:%2:%3:%4:%6:%5",_name,_cash,_bank,_licenses,_uid,_gear];};
  640. Dans votre dossier Functions\Systems\fn_getVehicles.sqf
  641. case east: {"adac"};
  642. Dans votre dossier Functions\Systems\fn_VehicleCreate.sqf
  643. case east: {"adac"};
  644. Dans votre dossier Functions\Systems\fn_managesc.sqf
  645. case east:
  646. {
  647. if(_bool) then
  648. {
  649. life_radio_east radioChannelAdd [_unit];
  650. }
  651. else
  652. {
  653. life_radio_east radioChannelRemove [_unit];
  654. };
  655. };
  656. Voila c'est finis, maintenant il ne vous reste qu'a rajouter des Opfor avec l'éditeur 2D.
  657.  
  658. 1432316587-opfor.jpg
  659.  
  660.  
  661. N'oubliez pas quand vous avez finis de rajouter vos Opfor enregistrez votre map puis remplacer la par l'ancienne dans la racine de votre Mission.
  662.  
  663. Ps: Je répondrais aux questions, mais si vous suivez bien, vous n'aurez pas de problème.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement