Advertisement
danya777_kirov

[SAMP-CLEO] 3D menu

Jul 27th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.21 KB | None | 0 0
  1. var
  2.  $text : array 10 of int
  3.  $element : int
  4. end
  5.  
  6. const
  7.  MAX_ELEMENTS = 3
  8. end
  9.  
  10. :Create3DMenu
  11. /*
  12.     use: 0AB1: @Create3DMenu 1 activ_element 0
  13. */
  14. 0AB1: @ActorFreeze 1 true
  15. 04C4: store_coords_to 4@ 5@ 6@ from_actor $player_actor with_offset -0.7 -0.7 0.0
  16. Camera.Restore_WithJumpCut()
  17. 068D: get_camera_position_to 7@ 8@ 6@
  18. for 1@ = 1 to MAX_ELEMENTS step 1
  19.     0085: 2@ = 1@
  20.     2@ *= 0x19
  21.     0AC6: 3@ = label @Text3DMenu offset
  22.     005A: 3@ += 2@
  23.     6@ -= 0.07
  24.     if 003B: 1@ == 0@
  25.     then 0B44: samp $text[1@] = create_3d_text 3@ color 0xFFFFC425 position 4@ 5@ 6@ view_distance 50.0 show_behind_walls true attached_to_player -1 attached_to_vehicle -1
  26.     else 0B44: samp $text[1@] = create_3d_text 3@ color 0xFFFFFFFF position 4@ 5@ 6@ view_distance 50.0 show_behind_walls true attached_to_player -1 attached_to_vehicle -1
  27.     end
  28. end
  29. 0AB2: ret 0
  30.  
  31. :Destroy3DMenu
  32. /*
  33.     use 0AB1: @Destroy3DMenu 0
  34. */
  35. for 0@ = 1 to MAX_ELEMENTS step 1
  36.     if 0B46: samp 3d_text $text[0@] defined
  37.     jf continue
  38.     0B45: samp destroy_3d_text $text[0@]
  39. end
  40. 0AB1: @ActorFreeze 1 false
  41. 0AB2: ret 0
  42.  
  43. :IsClosed3DMenu
  44. /*
  45.     use: 0AB1: @IsClosed3DMenu 0 return: closed_element 0@
  46. */
  47. if or
  48.     0AB0: 0x57
  49.     0AB0: 0x26
  50. then
  51.     0@ = 1
  52.     if $element == 1
  53.     then $element = MAX_ELEMENTS
  54.     else $element --
  55.     end
  56. end
  57.  
  58. if or
  59.     0AB0: 0x53
  60.     0AB0: 0x28
  61. then
  62.     0@ = 1
  63.     if $element == MAX_ELEMENTS
  64.     then $element = 1
  65.     else $element ++
  66.     end
  67. end
  68.  
  69. if 0@ == 1
  70. then
  71.     0AB1: @Destroy3DMenu 0
  72.     0AB1: @Create3DMenu 1 activ_element $element
  73.     wait 100
  74. end
  75.  
  76. if 0AB0: 0xD // enter
  77. then 0AB1: @Destroy3DMenu 0
  78. end
  79. 0AB2: ret 1 $element
  80.  
  81. :ActorFreeze
  82. 0A96: 1@ = actor $player_actor struct
  83. 1@ += 0x598
  84. 0A8C: write_memory 1@ size 1 value 0@ virtual_protect 0
  85. Actor.LockInCurrentPosition($PLAYER_ACTOR, 0@)
  86. 0AB2: ret 0
  87.  
  88. :Text3DMenu
  89. // Default size 25 byte
  90. hex
  91. {0} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // Íå èñïîëüçîâàòü!
  92. {1} "Element1" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  93. {2} "Element2" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  94. {3} "Exit" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement