Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //telecharger le script ici: http://www.armaholic.com/page.php?id=26499
- //copier coller le dossier AF_Keypad dans la racine de votre mission.
- //dans le fichier description.sqf de votre mission coller les deux lignes suivantes:
- #include "AF_Keypad\AF_KP_defines.hpp"
- #include "AF_Keypad\AF_KP_dialogs.hpp"
- //dans le fichier init.sqf de votre mission coller la ligne suivante:
- _nul = []execVM "AF_Keypad\AF_KP_vars.sqf";
- //placer une porte ou portail dans l'editeur EDEN, la nommer door1 par exemple.
- //dans l'init de la porte ou du portail mettre la ligne suivante:
- door1 setVariable ['bis_disabled_door_1',1,true]; //la porte sera fermée au lancement de la mission.
- //coller la ligne suivante dans un objet de type ordinateur, tablette ou autre pour activer le keypad par addaction.
- this addAction["ENTRER CODE",{createDialog "AF_Keypad";},"player distance this < 1"];
- //ensuite dans le dossier AF_Keypad ouvrir le fichier AF_KP_fncs.sqf pour pouvoir changer les codes des portes
- //et rentrer les noms de vos portes.
- //contenu du fichier AF_KP_fncs.sqf (exemple pour trois portes différentes):
- //This checks the variables passed in the execVM statments("number","enter" or "clear")
- switch (_this select 0) do {
- case "number": {
- InputText = InputText + format["%1", _this select 1];
- ctrlSetText[1000, InputText];
- };
- case "clear": {
- InputText = "";
- ctrlSetText[1000, ClearText];
- };
- case "enter": {
- _error="1";
- OutputText = InputText;
- // hint format["code trouvé %1 ", OutputText];
- closeDialog 0;
- InputText = "";
- // codes portes:
- //porte n°1
- if (OutputText == "0001") then {
- hint "DEVERROUILLAGE PORTE 1";
- door1 setVariable ['bis_disabled_door_1',0,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- if (OutputText == "0011") then {
- hint "VERROUILLAGE PORTE 1";
- door1 setVariable ['bis_disabled_door_1',1,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- //porte n°2
- if (OutputText == "0002") then {
- hintSilent "DEVERROUILLAGE PORTE 2";
- door2 setVariable ['bis_disabled_door_1',0,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- if (OutputText == "0022") then {
- hintSilent "VERROUILLAGE PORTE 2";
- door2 setVariable ['bis_disabled_door_1',1,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- //porte n°3
- if (OutputText == "0003") then {
- hintSilent "DEVERROUILLAGE PORTE 3";
- door3 setVariable ['bis_disabled_door_1',0,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- if (OutputText == "0033") then {
- hintSilent "VERROUILLAGE PORTE 3";
- door3 setVariable ['bis_disabled_door_1',1,true];
- _error="0";
- sleep 4;
- hintSilent "";
- };
- if (_error == "1") then {
- hintSilent "CODE INVALIDE";
- sleep 4;
- hintSilent "";
- }
- // -----------------------------------
- };
- };
- //et voilà... enjoy.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement