Jump to content

dxDrawText


Sasu

Recommended Posts

Posted
    function select() 
    addEventHandler("onClientRender", getLocalPlayer(), draw) 
    showCursor(true) 
    setElementFrozen(localPlayer, true) 
    end 
addEventHandler("onClientPlayerJoin", getLocalPlayer(), onSelectLanguage) 

Why this dont work?

State: Inactive

Posted (edited)
  
function select() 
           addEventHandler("onClientRender", getLocalPlayer(), draw) 
    showCursor(true) 
           setElementFrozen(localPlayer, true) 
    end 
addEventHandler("onClientResourceStart", getLocalPlayer(), select) 

Edited by Guest

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted

"onClientPlayerJoin" is only triggered when a remote player joins, use "onClientResourceStart" instead.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Do what I said above.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ahh yes. You are right. Well, I asked you solid about this :

function clickSelect(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) 
   local showing = isCursorShowing () 
   if showing then 
   local x1, y1, wx, wy, wz = getCursorPosition() 
   if x1 == 0.18671875 and y1 == 0.401 then 
   removeEventHandler("onClientRender", getLocalPlayer(), draw) 
    showCursor(false) 
    setElementFrozen(localPlayer, false) 
   setElementData( localPlayer, "Idioma", "Español") 
   elseif x1 == 0.551 and y1 == 0.401 then 
   removeEventHandler("onClientRender", getLocalPlayer(), draw) 
    showCursor(false) 
    setElementFrozen(localPlayer, false) 
   setElementData( localPlayer,  "Idioma", "English") 
   end 
   end 
   end 
addEventHandler("onClientClick", root, clickSelect) 
    

I tested but dont works.

State: Inactive

Posted

Try debugging your script, add outputs after 'if''s' and so on.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Nothing :_

function clickSelect(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) 
   local showing = isCursorShowing () 
   if showing then 
   local x1, y1, wx, wy, wz = getCursorPosition() 
   if x1 == x*0.18671875 and y1 == y*0.401 then 
   removeEventHandler("onClientRender", getLocalPlayer(), draw) 
   outputChatBox("Ha seleccionado el Idioma \"Español\" .", 0, 255, 0, false) 
    showCursor(false) 
    setElementFrozen(localPlayer, false) 
   setElementData( localPlayer, "Idioma", "Español") 
   elseif x1 == x*0.551 and y1 == y*0.401 then 
   removeEventHandler("onClientRender", getLocalPlayer(), draw) 
   outputChatBox("You selected the language \"English\" .", 0, 255, 0, false) 
    showCursor(false) 
    setElementFrozen(localPlayer, false) 
   setElementData( localPlayer,  "Idioma", "English") 
   end 
   end 
   end 
addEventHandler("onClientClick", root, clickSelect) 

See the dx:

    function draw() 
        dxDrawRectangle(0, 0, x*1, y*1, tocolor(0, 0, 0, 206), false) 
        dxDrawImage(x*0.18671875, y*0.401, x*0.275, y*0.322, "images/espanol.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawImage(x*0.551, y*0.401, x*0.275, y*0.322, "images/ingles.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawText("Elige tu idioma / Select your language", x*0.17421875, y*0.0846354166666667, x*0.83984375, y*0.1640625, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Español", x*0.2546875, y*0.2994791666666667, x*0.39296875, y*0.3645833333333333, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("English", x*0.6140625, y*0.2994791666666667, x*0.740625, y*0.3671875, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
    end 

State: Inactive

Posted
if x1 == x*0.18671875 and y1 == y*0.401 then 

Where is "x" defined?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
if x1 == x*0.18671875 and y1 == y*0.401 then 

Where is "x" defined?

local x,y = guiGetScreenSize() 

State: Inactive

Posted

The problem is on your 'if' to check for clicked position.

I got a question, why don't you just use GUI images?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...