Advertisement
Ketechi

Public | DeadEye & Buttons Tutorial

Jun 1st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.83 KB | None | 0 0
  1. // This program was created for a tutorial, to open and edit the script properly you will need Gtuner IV.
  2. // The tutorial was made for Xbox One
  3.  
  4. // GtunerIV link: https://www.consoletuner.com/titan-two-downloads/
  5.  
  6. #include <xb1.gph>
  7. bool isActive = FALSE; // Esta variable decide si el DeadEye esta activo o no.
  8.  
  9. // Main loop
  10. main {
  11.     activateDeadEye();
  12.    
  13.     if(isActive)
  14.         deadeye();
  15. }
  16.  
  17. // Activa el DeadEye antes de disparar.
  18. void deadeye()
  19. {
  20.     if(get_actual(XB1_RT) >= 25.0)
  21.         set_val(XB1_RS, 100.0);
  22. }
  23.  
  24. // Activa y desactiva la opcion de DeadEye automatico.
  25. void activateDeadEye()
  26. {
  27.     if(is_active(XB1_RB) && get_actual(XB1_LB) <= 0.0 && get_prev(XB1_LB) >= 100.0) // Manten oprimido RB y solo oprime LB una vez.
  28.     {
  29.         isActive = !isActive;
  30.        
  31.         if(isActive)
  32.             printf("Active");
  33.         else
  34.             printf("Not Active");
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement