Advertisement
J16D

example menu & jump table use [CLEO] GTA SA

Apr 21st, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. {
  2. MENU_AND_JUMPTABLE
  3. }
  4. const
  5. L_PANEL_VAR = 0@
  6. L_ACTIVE_ROW_VAR = 1@
  7. L_PANEL_IS_SHOWN_VAR = 2@
  8. end
  9.  
  10. {$CLEO}
  11. 0000:
  12.  
  13. while true
  14. wait 0
  15. if 0256: player $PLAYER_CHAR defined
  16. then
  17. if
  18. L_PANEL_IS_SHOWN_VAR == 0
  19. then
  20. if and
  21. 00E1: player 0 pressed_key 9 //--- key = GROUP_CONTROL_BWD
  22. 80DF: not actor $PLAYER_ACTOR driving
  23. then
  24. gosub @MENU_1
  25. end
  26. else // if menue is shown, if L_PANEL_IS_SHOWN_VAR == 1
  27. if
  28. 00E1: player 0 pressed_key 16 //--- key = Ped SPRINT
  29. then
  30. gosub @Selection_1
  31. end
  32. if
  33. 00E1: player 0 pressed_key 15 //--- key = Enter/Exit
  34. then
  35. gosub @Remove_panel
  36. end
  37. end
  38. else //if player dies or gets arrested
  39. if
  40. L_PANEL_IS_SHOWN_VAR == 1
  41. then
  42. gosub @Remove_panel //if player dies or gets arrested while meue is shown
  43. end
  44. end
  45. end
  46.  
  47. :MENU_1
  48. 08D4: L_PANEL_VAR = create_panel_with_title 'CHEAT7' position 340.0 120.0 width 240.0 columns 1 interactive 1 background 1 alignment 0
  49. 08DB: set_panel L_PANEL_VAR column 0 header 'PLA_19' data 'DEBW1' 'DEBW2' 'DEBW3' 'DEBW4' 'DEBW5' 'DEBW6' 'DEBW7' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW11' 'DEBW12'
  50. L_PANEL_IS_SHOWN_VAR = 1
  51. return
  52.  
  53. :Remove_panel
  54. 08DA: remove_panel L_PANEL_VAR
  55. L_PANEL_IS_SHOWN_VAR = 0
  56. return
  57.  
  58. :Selection_1
  59. 08D7: L_ACTIVE_ROW_VAR = panel L_PANEL_VAR active_row
  60. 0871: init_jump_table L_ACTIVE_ROW_VAR total_jumps 12 0 @Sel_T00 jumps 0 @Sel_T01 1 @Sel_T11 2 @Sel_T22 3 @Sel_T33 4 @Sel_T44 5 @Sel_T55 6 @Sel_T66
  61. 0872: jump_table_jumps 7 @Sel_T77 8 @Sel_T88 9 @Sel_T99 10 @Sel_T101 11 @Sel_T111 -1 @Sel_T00 -1 @Sel_T00 -1 @Sel_T00 -1 @Sel_T00
  62.  
  63. :Sel_T00// here goes the code if the value of the variable not exist in the jumptable
  64. 00BA: text_styled 'fem_off' 1000 ms 4
  65. wait 1000
  66. jump @Sel_EXIT
  67.  
  68. :Sel_T01
  69. set_weather 0// = Extra Sunny LA
  70. jump @Sel_EXIT
  71.  
  72. :Sel_T11
  73. set_weather 1// = Sunny LA
  74. jump @Sel_EXIT
  75.  
  76. :Sel_T22
  77. set_weather 2// = Sunny LA
  78. jump @Sel_EXIT
  79.  
  80. :Sel_T33
  81. set_weather 3// = Sunny Smog LA
  82. jump @Sel_EXIT
  83.  
  84. :Sel_T44
  85. set_weather 4// = Cloudy LA
  86. jump @Sel_EXIT
  87.  
  88. :Sel_T55
  89. set_weather 5// = Sunny SF
  90. jump @Sel_EXIT
  91.  
  92. :Sel_T66
  93. set_weather 6// = Extra Sunny SF
  94. jump @Sel_EXIT
  95.  
  96. :Sel_T77
  97. set_weather 7// = Cloudy SF
  98. jump @Sel_EXIT
  99.  
  100. :Sel_T88
  101. set_weather 8// = Rainy SF
  102. jump @Sel_EXIT
  103.  
  104. :Sel_T99
  105. set_weather 9// = Foggy SF
  106. jump @Sel_EXIT
  107.  
  108. :Sel_T101
  109. set_weather 10// = Sunny LV
  110. jump @Sel_EXIT
  111.  
  112. :Sel_T111
  113. set_weather 11// Extra Sunny LV
  114. jump @Sel_EXIT
  115.  
  116. :Sel_EXIT
  117. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement