Jump to content

[ajuda]


Recommended Posts

Bom eu criei Um pickup de info quando o player chegar no pickup ia abrir um rectangle nele e dentro do rectangle um dxdraw text falando algumas coisas so que no meu script so cria o pickup mas nada

nfoz = createPickup(2796.53076, -1549.46838, 10.92188,3,1239) 
  
local x,y = guiGetScreenSize() 
local Text = "Bem vindo a galocura" 
  
  
    dxDrawRectangle ( x/18, y/3, x/3.5, y/3, tocolor ( 0, 0, 0, 180 ) ) 
    dxDrawText ( "BEM VIDO A GALOCURA", x/6.5, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 0.8, "default-bold" ) 
addEventHandler("onClientPickupHit", infoz, 
function (player,matchingDimension) 
    if player == localPlayer and matchingDimension then 
        lastInfoPickupHit = getTickCount()+5000 
        if not pickupInfoHandler then 
            pickupInfoHandler = true 
            addEventHandler("onClientRender", root, drawStuff) 
        end 
    end 
end) 

Link to comment

funções dx precisam de um evento render para funcionarem;

     dxDrawRectangle ( x/18, y/3, x/3.5, y/3, tocolor ( 0, 0, 0, 180 ) ) 
     dxDrawText ( "BEM VIDO A GALOCURA", x/6.5, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 0.8, "default-bold" ) 
    -- Aqui você esta chamando a função no nada, sem eventos .. (n vai funcionar ) 

--[...] 
        if not pickupInfoHandler then 
            pickupInfoHandler = true 
            addEventHandler("onClientRender", root, drawStuff) 
            -- /\ aqui você adiciona o evento onClientRender a funcao drawStuff ( q n existe ) 
--[...] 

Tente assim :

infoz = createPickup(2796.53076, -1549.46838, 10.92188,3,1239) -- imaginei q a variavel fosse 'infoz' (tava errada) 
  
local x,y = guiGetScreenSize() 
local Text = "Bem vindo a galocura" 
  
addEventHandler("onClientPickupHit", infoz, 
function (player,matchingDimension) 
    if player == localPlayer and matchingDimension then 
        lastInfoPickupHit = getTickCount()+5000 
        if not pickupInfoHandler then 
            pickupInfoHandler = true 
            addEventHandler("onClientRender", root, drawStuff) 
        end 
    end 
end) 
  
function drawStuff ( ) -- funcao drawStuff ( para parar ela use removeEventHandler ) 
    dxDrawRectangle ( x/18, y/3, x/3.5, y/3, tocolor ( 0, 0, 0, 180 ) ) 
    dxDrawText ( Text, x/6.5, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 0.8, "default-bold" ) 
end 

Link to comment

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...