Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 5.59 KB | None | 0 0
  1. /*
  2. por: quickskill
  3.  
  4. el objetivo es que tardes unos 20 minutos moviendote de punto en punto
  5. this addAction["Solicitar trabajo en Fumigaciones Gato Volador", { ["solicito"] spawn QUICK_fnc_fumigador;}];
  6.  
  7. this addAction["Devolver avioneta a Fumigaciones Gato Volador", { ["fianza"] spawn QUICK_fnc_fumigador;}];
  8.  
  9. this addAction["Cobrar paga de fumigador", { ["cobrarTrabajo"] spawn QUICK_fnc_fumigador;}];
  10.  
  11.  
  12. */
  13.  
  14. _param = _this select 0;
  15. _veh = _this select 1;
  16.  
  17.  
  18.  
  19.  
  20.  
  21. if (_param isEqualTo "trabajo") exitWith {
  22.  
  23. if ((player getvariable "trabajo_fumigador_activo") > 0) exitwith {};
  24.    
  25.     //empieza a trabajar
  26.     player setvariable ["trabajo_fumigador_activo",1,true];
  27.    
  28.  
  29.  
  30.     //vars
  31.     _time = 60 * 35;
  32.     _ruta_random = round (random 4);
  33.     _veh = nearestObject [player, "C_Plane_Civil_01_F"];  
  34.     _finTrayecto = 0;
  35.     _zonaFumigar = "Fournos";
  36.      _solo1Vez=0;
  37.    
  38.    
  39.     if(_ruta_random == 0) then {
  40.         _zonaFumigar = "Fournos";  
  41.     };
  42.  
  43.     if(_ruta_random == 1) then {
  44.         _zonaFumigar = "Oreokastro";
  45.     };
  46.  
  47.     if(_ruta_random == 2) then {
  48.         _zonaFumigar = "Sideras";
  49.     };
  50.    
  51.     if(_ruta_random == 3) then {
  52.         _zonaFumigar = "Dorida";
  53.     };
  54.    
  55.     if(_ruta_random == 4) then {
  56.         _zonaFumigar = "Eginio";
  57.     };
  58.  
  59.     _posDestino = getMarkerPos _zonaFumigar;
  60.    
  61.  
  62.    
  63.     //creamos flecha
  64.     _flechaDir = "Sign_Arrow_Direction_F" createVehicleLocal (position _veh);
  65.     _flechaDir attachTo [_veh, [0,0,1]];
  66.     _fromTo = ((position  _veh ) vectorFromTo  _posDestino);
  67.     _flechaDir setDir ((_fromTo select 0) atan2 (_fromTo select 1)) - (getDir _veh);
  68.  
  69.     sleep 1;
  70.     hint "Todo listo, ve a fumigar los campos  y seras recompensado";
  71.     sleep 1;
  72.  
  73. //loop cuenta atras
  74. while {_time > 0} do {
  75.  
  76.     //distancia
  77.    
  78.     _metros =  _veh distance _posDestino;
  79.  
  80.     //actu flecha
  81.     _fromTo = ((position  _veh ) vectorFromTo _posDestino);
  82.     _flechaDir setDir ((_fromTo select 0) atan2 (_fromTo select 1)) - (getDir _veh);
  83.  
  84.     //tiempo
  85.      sleep 1;
  86.      _time = _time - 1;
  87.  
  88.     hintSilent format["Destino: %3 \n Tiempo : %1 \n Distancia: %2m ", [((_time)/60)+.01,"HH:MM"] call BIS_fnc_timetostring,round (_metros), _zonaFumigar];
  89.  
  90.  
  91.     /// si muere paramos el contador
  92.    if !(alive player) then {   _time = 0;     };
  93.  
  94.    
  95.    //empezamos a fumigar
  96.     if(_metros < 1200  )then{
  97.  
  98.         if(_solo1Vez==0)then{
  99.  
  100.             _humo = "SmokeShellYellow" createVehicle position _veh;
  101.             _humo attachTo [_veh, [-1, -0.8, 0] ];
  102.  
  103.             _solo1Vez=1;
  104.         }
  105.  
  106.     };
  107.    
  108.  
  109.  
  110.    
  111.     // el tio se toca los huevos pues no cobras
  112.    
  113.     if (_time <= 0 ) then {
  114.            
  115.        hint "Que tio mas lento, no te pagaremos nada por tu trabajo, vuelve a empezar la ruta holgazan";
  116.        player setvariable ["trabajo_fumigador_activo",0,true];
  117.  
  118.        _time = 0;
  119.      
  120.      };
  121.  
  122.  
  123.          //llegamos al destino
  124.  
  125.     if(_metros < 500 )then{  
  126.  
  127.               hint "Buen trabajo ya puedes ir a cobrar.";
  128.  
  129.         //ha llegado a su destino final ya puede cobrar
  130.  
  131.         player setvariable ["pagar_fumigador",1,true];
  132.  
  133.         _time = 0;
  134.  
  135.     };
  136.  
  137.  
  138.  
  139. };//end while
  140.  
  141.  
  142.  
  143. };
  144.  
  145. if (_param isEqualTo "cobrarTrabajo") exitWith {
  146.  
  147. if ((count (nearestObjects [player, ["man"], 10]))>1) exitwith {hint "De uno en uno por favor"};
  148.  
  149. if ((player getvariable "pagar_fumigador") == 0) exitwith {hint "Trabaja primero, que te crees que eres politico?¿?"};
  150.  
  151.  
  152.    
  153.     if ((player getvariable "pagar_fumigador") > 0) exitwith {
  154.             hint "Fantástico, has trabajado duro, aqui tienes tu recompensa.";
  155.                 //quick skill
  156.  
  157.             _pago = 120000;
  158.  
  159.             //pagamos
  160.  
  161.             life_cash = life_cash + _pago;
  162.            
  163.  
  164.           player setvariable ["pagar_fumigador",0,true];
  165.           player setvariable ["trabajo_fumigador_activo",0,true];
  166.        
  167.     };
  168.  
  169.  
  170.  
  171. };
  172.  
  173. if (_param isEqualTo "solicito") exitWith {
  174.  
  175.     if ((count (nearestObjects [player, ["man"], 10]))>1) exitwith {hint "De uno en uno por favor"};
  176.  
  177.  
  178.  
  179.     if (life_cash < 200000) exitwith {hint "La fianza de la avioneta  son 200000 €"};
  180.     life_cash = life_cash - 200000;
  181.     _veh = "C_Plane_Civil_01_F" createvehicle getMarkerPos "avioneta_fumigador";
  182.     player setvariable ["pagar_fumigador",0,true];
  183.     _veh setvariable ["propietario",name player,true];
  184.     player moveInDriver _veh;
  185.    
  186.  
  187. //add actions
  188. _veh  addAction["Empezar trabajo para Fumigaciones Gato Volador.", {["trabajo"] spawn QUICK_fnc_fumigador}];
  189.  
  190.  
  191.    // player setvariable ["uniforme",uniform player,true];
  192.     player addHeadgear "H_PilotHelmetHeli_O";
  193.     player forceAddUniform "U_I_pilotCoveralls";
  194.  
  195.  
  196. };
  197.  
  198.  
  199. if (_param isEqualTo "fianza") exitWith {
  200.  
  201.  
  202.  
  203.  
  204.     if ((count (nearestObjects [player, ["man"], 10]))>1) exitwith {hint "De uno en uno por favor"};
  205.     _veh = nearestObject [player, "C_Plane_Civil_01_F"];
  206.     if (isnil "_veh") exitwith {hint "No veo cerca ningúna avioneta"};
  207.     if ((player distance _veh)>10) exitwith {hint "Acerca la avioneta"};
  208.     _propietario = _veh getvariable "propietario";
  209.     if (name player != _propietario) exitwith {hint "Esta avioneta no esta registrada a tu nombre"};
  210.     deletevehicle _veh;
  211.     //_uniforme = player getvariable "uniforme";
  212.     //player adduniform _uniforme;
  213.     removeHeadgear player;
  214.     life_cash = life_cash + 200000;
  215.     deleteVehicle _flechaDir;
  216.     hint "Todo listo, avioneta guardado en el hangar, vuelve a por más trabajo cuando quieras";
  217.     player setvariable ["trabajo_fumigador_activo",0,true];
  218. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement