DragoN321
Typowy CJ z MTA
Wiek: 22 Na forum: 3355 dni Posty: 103
Nick w MP: Szel
Piwa : 5539
Cze??, mam problem z ustawieniem blip?w pod mape vice city. Na poczatku gry porusz? si? o niewielk? ilo?? blip wskazuje idealnie, ale gdy porusz? si? nieco dalej blip szwankuje i wywala go o kilka ulic dalej.
addEventHandler ( 'onClientRender' , root ,
function()
if ( Bigmap . IsVisible ) then
local absoluteX , absoluteY = 0 , 0 ;
if ( getElementInterior ( localPlayer ) == 0 ) then
if ( isCursorShowing ()) then
local cursorX , cursorY = getCursorPosition ();
local mapX , mapY = getWorldFromMapPosition ( cursorX , cursorY );
absoluteX = cursorX * Display . Width ;
absoluteY = cursorY * Display . Height ;
if ( getKeyState ( 'mouse1' ) and mapIsMoving ) then
playerX = -( absoluteX * Bigmap . CurrentZoom - mapOffsetX );
playerY = absoluteY * Bigmap . CurrentZoom - mapOffsetY ;
playerX = math . max (- 2000 , math . min ( 2000 , playerX ));
playerY = math . max (- 2000 , math . min ( 2000 , playerY ));
Bigmap . FollowPosition = false
end
end
if Bigmap . FollowPosition then
playerX = playerX + ( Bigmap . FollowPosition [ 1 ] - playerX ) * 0.03 ;
playerY = playerY + ( Bigmap . FollowPosition [ 2 ] - playerY ) * 0.03 ;
end
local playerRotation = getPedRotation ( localPlayer );
local mapX = ((( 3475 + playerX ) * Minimap . MapUnit ) - ( Bigmap . Width / 2 ) * Bigmap . CurrentZoom );
local mapY = ((( 2730 - playerY ) * Minimap . MapUnit ) - ( Bigmap . Height / 2 ) * Bigmap . CurrentZoom );
local mapWidth , mapHeight = Bigmap . Width * Bigmap . CurrentZoom , Bigmap . Height * Bigmap . CurrentZoom ;
dxSetBlendMode ( "modulate_add" )
dxSetRenderTarget ( Bigmap . GPSTexture , true );
local gps = getElementData ( localPlayer , "player:gps" )
local lwx , lwy ;
if gps then
local lx , ly , lz ;
for k , v in pairs ( gps ) do
if v then
local x , y = v . x + 3475 , (- v . y + 2730 )
x , y = x * Minimap . MapUnit , y * Minimap . MapUnit
if lx then
dxDrawLine ( lx , ly , x , y , tocolor ( 252 , 3 , 127 , 255 ), 6 )
for _x = - 1 , 1 do
for _y = - 1 , 1 do
dxDrawLine ( lx + _x , ly + _y , x + _x , y + _y , tocolor ( 252 , 3 , 127 , 55 ), 6 )
end
end
end
lx , ly , lz = x , y
lwx , lwy = v . x , v . y
end
end
end
dxSetRenderTarget ();
dxSetBlendMode ( "blend" )
dxDrawImageSection ( Bigmap . PosX , Bigmap . PosY , Bigmap . Width , Bigmap . Height , mapX , mapY , mapWidth , mapHeight , Minimap . MapTexture , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ));