Szerző Téma: Dx Négyzetbe kattintás!  (Megtekintve 886 alkalommal)

Nem elérhető Tarack

  • 177
    • Profil megtekintése
Dx Négyzetbe kattintás!
« Dátum: 2015. Március 04. - 14:28:29 »
0
Sziasztok. Lenne itt nekem egy kódom. A kérdésem az lenne,hogy ha ez egyik négyzetre rákattintunk,akkor valami interakció legyen (pl teleport,de azt megoldom!).
Csak azt hogy kellene,hogy tudjak bele klikkelni.
Próbáltam már azzala kóddal,ami fent van a neten,de ehez a scripthez az nem jó.
Nos,itt is lenne az a kód amihez kéne ez.
function ( )
    if ( getDistanceBetweenPoints3D ( 1774,-1101.2,24.3, getElementPosition ( localPlayer ) ) ) < 3.5 then
    local coords = { getScreenFromWorldPosition (1774,-1101.2,24.3 ) }
    local x,y = guiGetScreenSize()   
    if coords[1] and coords[2] then
     
       
       
    dxDrawRectangle ( x*0.830,y*0.400, 280,120, tocolor ( 0,0,0,170 ) )
        dxDrawText ( \"Tunningok\",x*0.880,y*0.400, 280,120, tocolor ( 255,255,255,150 ),2 )
        dxDrawRectangle ( x*0.855,y*0.450, 200,40, tocolor ( 0,204,0,130 ) )
        dxDrawText ( \"Handling\",x*0.883,y*0.453, 280,120, tocolor ( 255,255,255,150 ),2 )
        end
             end
end )
Köszönöm előre is a válaszokat!

Nem elérhető Rod

Dx Négyzetbe kattintás!
« Válasz #1 Dátum: 2015. Március 04. - 14:37:10 »
0

function()
if (getDistanceBetweenPoints3D ( 1774,-1101.2,24.3, getElementPosition(localPlayer))) < 3.5 then
local coords = {getScreenFromWorldPosition(1774,-1101.2,24.3)}
local x,y = guiGetScreenSize()   
if coords[1] and coords[2] then
   absX, absY = 0, 0
   if isCursorShowing() then
      local relX, relY = getCursorPosition()
      absX = relX * x
      absY = relY * y
   end
   dxDrawRectangle ( x*0.830,y*0.400, 280,120, tocolor ( 0,0,0,170 ) )
   dxDrawText ( \"Tunningok\",x*0.880,y*0.400, 280,120, tocolor ( 255,255,255,150 ),2 )
   dxDrawRectangle ( x*0.855,y*0.450, 200,40, tocolor ( 0,204,0,130 ) )
   dxDrawText ( \"Handling\",x*0.883,y*0.453, 280,120, tocolor ( 255,255,255,150 ),2 )
end
end
end)
addEventHandler(\"onClientClick\", getRootElement(),
function (button, state, absoluteX, absoluteY)
if button == \"left\" then
   if state == \"up\" then
      if absoluteX >= x*0.830 and absoluteX <= x*0.830 + 32 and absoluteY >= y*0.400 and absoluteY <= y*0.400 + 32 then
         -- tuningok gomb
      elseif absoluteX >= x*0.883 and absoluteX <= x*0.883 + 32 and absoluteY >= y*0.453 and absoluteY <= y*0.453 + 32 then
         -- handling gomb
      end
   end
end
end
)

Nem elérhető Tarack

  • 177
    • Profil megtekintése
Dx Négyzetbe kattintás!
« Válasz #2 Dátum: 2015. Március 04. - 14:49:08 »
0
Nagyon köszönöm az ennyi fáradozást,de sajnos nem működik  :-\\
Hiába irom át a: *-os \"koordinátákat\",de semmi. Köszönöm szépen hogy próbáltál segíteni :)

Nem elérhető Rod

Dx Négyzetbe kattintás!
« Válasz #3 Dátum: 2015. Március 04. - 14:50:32 »
0
Ez működik, csak te írsz el valamit.

Nem elérhető Tarack

  • 177
    • Profil megtekintése
Dx Négyzetbe kattintás!
« Válasz #4 Dátum: 2015. Március 04. - 14:52:14 »
0
Hogyha így ctr+c és ctrl+v-zem akkor meg hibákat dobál a script editor.

Nem elérhető Rod

Dx Négyzetbe kattintás!
« Válasz #5 Dátum: 2015. Március 04. - 14:56:22 »
0
és milenne ha leírnád a hibákat? Lehet tudnék segíteni is..

Nem elérhető Tarack

  • 177
    • Profil megtekintése
Dx Négyzetbe kattintás!
« Válasz #6 Dátum: 2015. Március 04. - 14:58:37 »
0
<nem> expected near \'(\'
<eof> expected near \'end\'
Ha meg ezeket a hibákat kijavítom,akkor nem lehet klikkelni rá,de magát amit kell,azt lerendereli.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal