Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$CLEO}
- 0000:
- const
- FONT = 0@
- ID = 1@
- PING = 2@
- STR_PING = 3@
- STR_ZONE = 4@
- STR_FPS = 5@
- PLAYER_POS_X = 6@
- PLAYER_POS_Y = 7@
- PLAYER_POS_Z = 8@
- FPS_COUNT = 9@
- FPS_COUNT_COPY = 10@
- SYSTEM_TICK_COUNT = 11@
- DISPLAY_POS_X = 12@
- DISPLAY_POS_Y = 13@
- DISPLAY_POS_Y_BUFF = 14@
- TOGGLE_MODE_ADJUSTPOS = 15@
- TOGGLE_PING = 16@
- TOGGLE_FPS = 17@
- TOGGLE_ZONE = 18@
- STR_FONT_NAME = 19@
- MOD_SWITCH = 20@
- FONT_SIZE = 21@
- FONT_FLAGS = 22@
- TOGGLE_MODE_ADJUSTSIZE = 23@
- TOGGLE_MODE_ADJUSTFLAGS = 24@
- FONT_SIZE_BUFF = 25@
- TEXT_LENGTH = 26@
- DISPLAY_POS_X_BUFF = 27@
- ALIGNMENT = 28@
- GTX_ZONENAME = s$93
- end
- alloc STR_PING 64
- alloc STR_ZONE 64
- alloc STR_FPS 64
- alloc STR_FONT_NAME 64
- repeat
- wait 50
- until 0AFA: is_samp_available
- 0B34: samp register_client_command "sd" to_label @toggle
- 0B34: samp register_client_command "sdpos" to_label @adjustpos
- 0B34: samp register_client_command "sdhelp" to_label @help
- 0B34: samp register_client_command "sdping" to_label @tog_ping
- 0B34: samp register_client_command "sdfps" to_label @tog_fps
- 0B34: samp register_client_command "sdzone" to_label @tog_zone
- 0B34: samp register_client_command "sdflags" to_label @adjustflags
- 0B34: samp register_client_command "sdsize" to_label @adjustsize
- 0B34: samp register_client_command "sdalign" to_label @changeAlignment
- 0AF8: samp add_message_to_chat "{F7F694}statDisplay mod. Use {FF4800}/sdhelp {F7F694}to see commands"
- /* flags
- FCR_NONE 0 Text without features
- FCR_BOLD 1 Fat content of the text
- FCR_ITALICS 2 Bent (italic) text
- FCR_BORDER 4 Dribbling text
- FCR_SHADOW 8 text Shadow
- FCR_UNDERLINE 16 Underlined text
- FCR_STRIKEOUT 32 Strikethrough text
- */
- if 0AAB: file_exists "CLEO\statDisplaySettings.ini"
- then
- 0AF4: STR_FONT_NAME = read_string_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "font_name"
- 0AF0: DISPLAY_POS_X = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "x"
- 0AF0: DISPLAY_POS_Y = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "y"
- 0AF0: MOD_SWITCH = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "switch"
- 0AF0: TOGGLE_PING = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "ping"
- 0AF0: TOGGLE_FPS = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "fps"
- 0AF0: TOGGLE_ZONE = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "location"
- 0AF0: FONT_SIZE = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "font_size"
- 0AF0: FONT_FLAGS = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "font_flags"
- 0AF0: ALIGNMENT = get_int_from_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "alignment"
- else
- 0AF8: samp add_message_to_chat "{F7F694}CLEO\statDisplaySettings.ini {FF4800}not found. {F7F694}The mod won't work"
- jump @Idle_loop
- end
- 0B6D: render FONT = create STR_FONT_NAME height FONT_SIZE flags FONT_FLAGS
- while true
- wait 0
- if MOD_SWITCH == 1
- then
- 0085: DISPLAY_POS_Y_BUFF = DISPLAY_POS_Y // (int)
- //adjust modes
- if TOGGLE_MODE_ADJUSTPOS == 1
- then 0AB1: @Position_stats 2 DISPLAY_POS_X DISPLAY_POS_Y _return DISPLAY_POS_X DISPLAY_POS_Y
- end
- if TOGGLE_MODE_ADJUSTSIZE == 1
- then
- if 0AB1: @Adjust_Font_Size 1 FONT_SIZE _ret FONT_SIZE
- then
- 0B6E: render release FONT
- 0B6D: render FONT = create STR_FONT_NAME height FONT_SIZE flags FONT_FLAGS
- wait 100
- end
- end
- if TOGGLE_MODE_ADJUSTFLAGS == 1
- then
- if 0AB1: @Adjust_Font_Flags 1 FONT_FLAGS _ret FONT_FLAGS
- then
- 0B6E: render release FONT
- 0B6D: render FONT = create_font STR_FONT_NAME height FONT_SIZE flags FONT_FLAGS
- wait 100
- end
- end
- //texts
- if TOGGLE_ZONE == 1
- then
- 00A0: store_actor $PLAYER_ACTOR position_to PLAYER_POS_X PLAYER_POS_Y PLAYER_POS_Z
- 0843: get_zone_at PLAYER_POS_X PLAYER_POS_Y PLAYER_POS_Z nameA_to GTX_ZONENAME
- 0ADE: STR_ZONE = text_by_GXT_entry GTX_ZONENAME
- if ALIGNMENT == 0 // left
- then
- 0B6F: render FONT draw_text STR_ZONE of pos DISPLAY_POS_X DISPLAY_POS_Y color 0xFFFFFFFF
- else
- 0B6B: render TEXT_LENGTH = FONT get_length_of STR_ZONE
- if ALIGNMENT == 1 //center
- then
- 0016: TEXT_LENGTH /= 2
- end
- 0085: DISPLAY_POS_X_BUFF = DISPLAY_POS_X
- 0062: DISPLAY_POS_X_BUFF -= TEXT_LENGTH
- 0B6F: render FONT draw_text STR_ZONE of pos DISPLAY_POS_X_BUFF DISPLAY_POS_Y color 0xFFFFFFFF
- end
- end
- if TOGGLE_PING == 1
- then
- 0B2B: samp ID = get_player_id_by_actor_handle $PLAYER_ACTOR
- 0B2A: samp PING = get_player_ping ID
- 0AD3: STR_PING = format "Ping: %d" PING
- 0085: FONT_SIZE_BUFF = FONT_SIZE // (int)
- 0012: FONT_SIZE_BUFF *= 10
- 0016: FONT_SIZE_BUFF /= 7
- 005A: DISPLAY_POS_Y_BUFF += FONT_SIZE_BUFF // (int)
- if ALIGNMENT == 0 // left
- then
- 0B6F: render FONT draw_text STR_PING of pos DISPLAY_POS_X DISPLAY_POS_Y_BUFF color 0xFFFFFFFF
- else
- 0B6B: render TEXT_LENGTH = FONT get_length_of STR_PING
- if ALIGNMENT == 1 //center
- then
- 0016: TEXT_LENGTH /= 2
- end
- 0085: DISPLAY_POS_X_BUFF = DISPLAY_POS_X
- 0062: DISPLAY_POS_X_BUFF -= TEXT_LENGTH
- 0B6F: render FONT draw_text STR_PING of pos DISPLAY_POS_X_BUFF DISPLAY_POS_Y_BUFF color 0xFFFFFFFF
- end
- end
- if TOGGLE_FPS == 1
- then
- FPS_COUNT += 1
- if 0AB1: @HalfSecondPassed 1 SYSTEM_TICK_COUNT _ret SYSTEM_TICK_COUNT
- then
- 0085: FPS_COUNT_COPY = FPS_COUNT // get time interval
- 0012: FPS_COUNT_COPY *= 2
- FPS_COUNT = 0
- end
- 0AD3: STR_FPS = format "Fps: %d" FPS_COUNT_COPY
- 0085: FONT_SIZE_BUFF = FONT_SIZE // (int)
- 0012: FONT_SIZE_BUFF *= 10
- 0016: FONT_SIZE_BUFF /= 7
- 005A: DISPLAY_POS_Y_BUFF += FONT_SIZE_BUFF // (int)
- if ALIGNMENT == 0 // left
- then
- 0B6F: render FONT draw_text STR_FPS of pos DISPLAY_POS_X DISPLAY_POS_Y_BUFF color 0xFFFFFFFF
- else
- 0B6B: render TEXT_LENGTH = FONT get_length_of STR_FPS
- if ALIGNMENT == 1 //center
- then
- 0016: TEXT_LENGTH /= 2
- end
- 0085: DISPLAY_POS_X_BUFF = DISPLAY_POS_X
- 0062: DISPLAY_POS_X_BUFF -= TEXT_LENGTH
- 0B6F: render FONT draw_text STR_FPS of pos DISPLAY_POS_X_BUFF DISPLAY_POS_Y_BUFF color 0xFFFFFFFF
- end
- end
- end
- end
- :Idle_loop
- wait 5000
- jump @Idle_loop
- :changeAlignment
- ALIGNMENT++
- if ALIGNMENT > 2
- then
- ALIGNMENT = 0
- end
- 0AF1: write_int ALIGNMENT to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "alignment"
- samp.CmdRet()
- :adjustpos
- wait 0
- 0B12: TOGGLE_MODE_ADJUSTPOS = TOGGLE_MODE_ADJUSTPOS XOR 1
- if TOGGLE_MODE_ADJUSTPOS == 1
- then
- 0B5D: samp toggle_cursor 1
- else
- 0B5D: samp toggle_cursor 0
- end
- samp.CmdRet
- :adjustsize
- 0B12: TOGGLE_MODE_ADJUSTSIZE = TOGGLE_MODE_ADJUSTSIZE XOR 1
- if TOGGLE_MODE_ADJUSTSIZE == 0
- then
- 0AF1: write_int FONT_SIZE to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "font_size"
- end
- samp.CmdRet
- :adjustflags
- 0B12: TOGGLE_MODE_ADJUSTFLAGS = TOGGLE_MODE_ADJUSTFLAGS XOR 1
- if TOGGLE_MODE_ADJUSTFLAGS == 0
- then
- 0AF1: write_int FONT_FLAGS to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "font_flags"
- end
- samp.CmdRet
- :tog_zone
- 0B12: TOGGLE_ZONE = TOGGLE_ZONE XOR 1
- 0AF1: write_int TOGGLE_ZONE to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "location"
- samp.CmdRet
- :tog_ping
- 0B12: TOGGLE_PING = TOGGLE_PING XOR 1
- 0AF1: write_int TOGGLE_PING to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "ping"
- samp.CmdRet
- :tog_fps
- 0B12: TOGGLE_FPS = TOGGLE_FPS XOR 1
- 0AF1: write_int TOGGLE_FPS to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "fps"
- samp.CmdRet
- /*
- :tog_
- 0B12: TOGGLE_ = TOGGLE_ XOR 1
- 0AF1: write_int 16 to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key ""
- samp.CmdRet
- :tog_
- 0B12: TOGGLE_ = TOGGLE_ XOR 1
- 0AF1: write_int 16 to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key ""
- samp.CmdRet
- */
- :help
- 0AF8: samp add_message_to_chat "{FF4800}statDisplay {F7F694}commands:"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sd {F7F694}(toggle whole mod)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdpos {F7F694}(allows to adjust the position of the stats)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdsize {F7F694}(set size of the font)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdalign {F7F694}(change text alignment, left, center, right)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdflags {F7F694}(set flags of the font)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdzone {F7F694}(toggle location)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdping {F7F694}(toggle ping)"
- 0AF8: samp add_message_to_chat "{FFFFFF}/sdfps {F7F694}(toggle fps)"
- samp.CmdRet()
- :toggle
- 0B12: MOD_SWITCH = MOD_SWITCH XOR 1
- 0AF1: write_int MOD_SWITCH to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "switch"
- if MOD_SWITCH == 1
- then
- FPS_COUNT = 0
- FPS_COUNT_COPY = 0
- //0A8D: 12@ = read_memory 0xB7CB84 size 4 virtual_protect 0
- 0AD1: show_formatted_text_highpriority "statDisplay is ~G~ON" time 700
- else
- 0AD1: show_formatted_text_highpriority "statDisplay is ~R~OFF" time 700
- end
- samp.CmdRet()
- //0AB1: @SecondPassed 1 second 0@ _second 0@
- :halfSecondPassed
- 0AA2: 2@ = load_library "kernel32.dll" // IF and SET
- if 0AA4: 3@ = get_proc_address "GetTickCount" library 2@ // http://www.geoffchappell.com/studies/windows/win32/kernel32/api/index.htm https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx
- then
- 1@ = 0 //GetSystemTimeA results in access violation if the pointer is NULL so just in case it's set to 1 first
- //0AA5: call_function 3@ num_params 1 pop 0 1@
- 0AA7: call_function 3@ num_params 0 pop 0 31@
- 30@ = 0
- 0085: 30@ = 31@ //
- 0062: 30@ -= 0@ //
- if 0019: 30@ >= 500
- then
- 0085: 0@ = 31@
- 0485: return_true
- else
- 059A: return_false
- end
- else
- 059A: return_false
- end
- 0AA3: free_library 2@
- 0AB2: ret 1 0@
- //0AB1: @Position_stats 3 XY 26@ 27@
- :Position_stats
- 0B5D: samp toggle_cursor 1
- if key_down 1
- then
- 0B5E: get_cursor_pos 0@ 1@
- //0B5F: convert_window_screen_coords 8@ 9@ to_game_screen_coords 10@ 11@
- 0AF1: write_int 0@ to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "x"
- 0AF1: write_int 1@ to_ini_file "CLEO\statDisplaySettings.ini" section "Settings" key "y"
- end
- //03E3: set_texture_to_be_drawn_antialiased 6
- //03F0: enable_text_draw 1
- //038D: draw_texture 6 position 0@ 1@ size 129.142960 45.333576 RGBA 150 150 150 150
- 0AD1: show_formatted_text_highpriority "Click anywhere + use /sdpos again to exit editing" time 100 0xF7F694
- 0AB2: ret 2 0@ 1@
- //0AB1: @Adjust_Font_Size 1
- :Adjust_Font_Size
- 31@ = false
- if key_down 104
- then
- 0@ += 1
- 31@ = true
- 0485: return_true
- else
- if key_down 98
- then
- 0@ -= 1
- 31@ = true
- end
- end
- if 001B: 0 > 0@
- then
- 0@ = 0
- else
- if 0019: 0@ > 63
- then
- 0@ = 63
- end
- end
- 0AD1: show_formatted_text_highpriority "Use numpad 8 and 2 to increase/decrease font size + use /sdsize again to exit editing" time 100 0xF7F694
- if 31@ == true
- then
- 0485: return_true
- else
- 059A: return_false
- end
- 0AB2: ret 1 0@
- //0AB1: @Adjust_Font_Flags 1
- :Adjust_Font_Flags
- 31@ = false
- if key_down 104
- then
- 0@ += 1
- 31@ = true
- 0485: return_true
- else
- if key_down 98
- then
- 0@ -= 1
- 31@ = true
- end
- end
- if 001B: 0 > 0@
- then
- 0@ = 0
- else
- if 0019: 0@ > 63
- then
- 0@ = 63
- end
- end
- 0AD1: show_formatted_text_highpriority "Use numpad 8 and 2 to set font flags + use /sdflags again to exit editing" time 100 0xF7F694
- if 31@ == true
- then
- 0485: return_true
- else
- 059A: return_false
- end
- 0AB2: ret 1 0@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement