Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Developers:
- • .WhiteBlue (szymon.lua@gmail.com)
- Copyright (c) 2018 .WhiteBlue (szymon.lua@gmail.com)
- Note (EN): You can not copy and share this code without my permission.
- Note (PL): Nie możesz kopiować i udostępniać tego kodu bez mojej zgody.
- ]]
- -- Variables
- local map = { ['player'] = {} }
- map['settings'] = {
- ['world_size'] = { ['w'] = 1536, ['h'] = 1536, },
- }
- local rt = dxCreateRenderTarget(1536, 1536)
- -- Functions
- map['render'] = function()
- if not move_x then move_x = 0 end
- if not move_y then move_y = 0 end
- if not last_move_x then last_move_x = 0 end
- if not last_move_y then last_move_y = 0 end
- local cursor_x, cursor_y = getCursorPosition()
- if getKeyState('num_4') then
- if scale_x(move_x - map['player']['scale']) < 0 then
- move_x = move_x + 20
- end
- elseif getKeyState('num_6') then
- if scale_x(move_x) < scale_x(move_x + map['player']['scale']) then
- move_x = move_x - 20
- end
- end
- iprint(move_x - map['player']['scale'], move_x + map['player']['scale'])
- if getKeyState('num_8') then
- if scale_y(move_y - map['player']['scale']) < 0 then
- move_y = move_y + 10
- end
- elseif getKeyState('num_2') then
- if scale_y(move_y - map['player']['scale']) < 0 then
- move_y = move_y - 10
- iprint(move_y)
- end
- end
- -- F11
- local position_player = Vector3(getElementPosition(localPlayer))
- local material_x, material_y = (position_player['x'] / (6000 / map['settings']['world_size']['w'])), (position_player['y'] / (6000 / map['settings']['world_size']['h']))
- local material_w, material_h = dxGetMaterialSize(rt)
- dxSetRenderTarget(rt, true)
- dxDrawRectangle(0, 0, material_w, material_h, 0xFF54707e)
- dxDrawImage(scale_x(move_x - map['player']['scale']), scale_y(move_y - map['player']['scale']), material_w + map['player']['scale'], material_h + map['player']['scale'], 'i/map.png', 0, 0, 0)
- dxSetRenderTarget()
- dxDrawImage(scale_x(510), scale_y(140), scale_x(900), scale_y(800), rt, 0, 0, 0, tocolor(255, 255, 255, 200))
- end
- map['show'] = function()
- map['player'] = {
- ['toggled'] = true,
- ['scale'] = 1,
- },
- showCursor(true, false)
- addEventHandler('onClientRender', root, map['render'])
- end
- map['hide'] = function()
- map['player'] = {}
- showCursor(false)
- removeEventHandler('onClientRender', root, map['render'])
- end
- bindKey('mouse_wheel_up', 'down', function()
- if not map['player']['scale'] then map['player']['scale'] = 1 end
- if map['player']['scale'] < 2000 then
- map['player']['scale'] = map['player']['scale'] + 100
- end
- end)
- bindKey('mouse_wheel_down', 'down', function()
- if not map['player']['scale'] then map['player']['scale'] = 1 end
- if map['player']['scale'] > 1 then
- map['player']['scale'] = map['player']['scale'] - 100
- end
- end)
- bindKey('F11', 'down', function()
- if map['player']['toggled'] then
- map['hide']()
- else
- map['show']()
- end
- end)
- addEventHandler('onClientResourceStart', resourceRoot, function() toggleControl('radar', false) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement