Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot?? mam problem, chcia?em zrobi? texture kamienia, ?e jak klikniemy raz wy-renderuje nam zniszczony kamie? w postaci nowego obrazu, drugi raz jeszcze bardziej zniszczony itd.
tak pr?bowa?em
if target [ 0 ] then
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , "nowy.png" )
elseif target [ 1 ] then
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , "nowy.png" )
elseif target [ 2 ] then
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , "sredni.png" )
elseif target [ 3 ] then
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , "max.png" )
end
local mousePoints = {
{ screenW * 0.3932 , screenH * 0.4787 , screenW * 0.0323 , screenH * 0.0509 },
{ screenW * 0.4516 , screenH * 0.5213 , screenW * 0.0323 , screenH * 0.0509 },
{ screenW * 0.5495 , screenH * 0.5528 , screenW * 0.0323 , screenH * 0.0509 },
{ screenW * 0.5969 , screenH * 0.5065 , screenW * 0.0198 , screenH * 0.0296 },
}
target = 0
addEventHandler ( "onClientMarkerHit" , startPracy , function( h )
if h ~= localPlayer then return end
if isPedInVehicle ( localPlayer ) then return end
setElementData ( localPlayer , "praca:kopalnia:gui" , true )
showCursor ( true )
end )
function isMouseIn ( x , y , width , height )
if ( not isCursorShowing ( ) ) then
return false
end
local sx , sy = guiGetScreenSize ( )
local cx , cy = getCursorPosition ( )
local cx , cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
setElementData ( localPlayer , "kopalnia:zakonczono" , false )
function tworzenieMarkera ()
rnd = math . random ( 1 , #punktykopalnia)
markerRandomowy = createMarker ( punktykopalnia [ rnd ][ 1 ], punktykopalnia [ rnd ][ 2 ], punktykopalnia [ rnd ][ 3 ], 'cylinder' , 1.5 )
blipRandomowy = createBlipAttachedTo ( markerRandomowy , 41 )
end
function onRandom ( h )
if h ~= localPlayer then return end
if isPedInVehicle ( localPlayer ) then return end
target = target + 1
setElementData ( localPlayer , "kopalnia:zakonczono" , false )
setPedAnimation ( localPlayer , "BASEBALL" , "Bat_4" , 1000 , false , false , false , false , 250 , false )
addEventHandler ( "onClientRender" , root , function()
if getElementData ( localPlayer , "kopalnia:zakonczono" ) then return end
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , "nowy.png" )
dxDrawImage ( mousePoints [ target ][ 1 ], mousePoints [ target ][ 2 ], mousePoints [ target ][ 3 ], mousePoints [ target ][ 4 ], "kolo.png" )
end )
showCursor ( true )
destroyElement ( source )
destroyElement ( blipRandomowy )
end
Za pomoc zimne piwko i +rep