Jump to content

Join


Arsilex

Recommended Posts

addEventHandler('onClientPlayerJoin', root, 
function() 
     setTimer(function(source) 
          local country = getElementData(source,"Country") 
          local imgPath = ":admin/client/images/flags/"..getElementData(source,"Country")..".png" 
          messageJoin = getPlayerName(source).." #00A6FFhas #FFFFFFJoin #00A6FFThe server from: "..country.."." 
          addEventHandler("onClientRender", root, renderPlayerJoined) 
          setTimer(function() 
               removeEventHandler("onClientRender", root, renderPlayerJoined) 
          end,7000,1) 
     end,250,1,source) 
end) 

que fallo tengo aqui es que me dice que el fallo esta en

          local imgPath = ":admin/client/images/flags/"..getElementData(source,"Country")..".png" 

::S:S:S:SS

Link to comment

Aver mira

function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) 
    local pat = "(.-)#(%x%x%x%x%x%x)" 
    local s, e, cap, col = str:find(pat, 1) 
    local last = 1 
    while s do 
        if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), 
        tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end 
        if s ~= 1 or cap ~= "" then 
            local w = dxGetTextWidth(cap, scale, font) 
            dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) 
            ax = ax + w 
            color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) 
        end 
        last = e + 1 
        s, e, cap, col = str:find( pat, last ) 
    end 
    if last <= #str then 
        cap = str:sub( last ) 
        local w = dxGetTextWidth( cap, scale, font ) 
        dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) 
    end 
end 
  
local messageJoin = "" 
local messageQuit = "" 
  
function renderPlayerJoined() 
    dxDrawImage(1289.0,57.0,38.0,29.0,"images/Join.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
    dxDrawColorText("".. messageJoin,1008.0,57.0,1359.0,84.0,tocolor(255,255,255,255),0.45,sans,"left","top",false,false,false) 
    local imgPath = ":admin/client/images/flags/"..getElementData(source,"Country")..".png" 
    dxDrawImage ( 966.0,57.0,38.0,29.0, imgPath , 0, 0, 0,tocolor(255,255,255,255),true) 
end 
  
function renderPlayerLeft() 
    dxDrawColorText("< ".. messageQuit,400,740.0,574.0,32.0,tocolor(255,255,255,255),0.45,sans,"left","top",false,false,false) 
end 
  
addEventHandler('onClientPlayerJoin', root, 
function() 
     setTimer(function(source) 
          local country = getElementData(source,"Country") 
          messageJoin = getPlayerName(source).." #00A6FFhas #FFFFFFJoin #00A6FFThe server from: "..country.."." 
          addEventHandler("onClientRender", root, renderPlayerJoined) 
          setTimer(function() 
               removeEventHandler("onClientRender", root, renderPlayerJoined) 
          end,7000,1) 
     end,250,1,source) 
end) 
  
addEventHandler('onClientPlayerQuit', root, 
function(reason) 
     messageQuit  = getPlayerName(source) .. " #00A6FFhas #FFFFFFLeft #00A6FFThe server.#FFFFFF [" .. reason .. "]" 
     addEventHandler("onClientRender", root, renderPlayerLeft) 
     setTimer(function() 
          removeEventHandler("onClientRender", root, renderPlayerLeft) 
     end,7000,1) 
end) 
  

addEventHandler('onPlayerJoin',g_Root, 
function () 
    local Home = exports.admin.getPlayerCountry(source) or "N/a" 
    setElementData(source,'Country',Home) 
end 
) 

No se que me falla alli

lo que yo quiero es que al entrar salga has joinder from Argentina y la IMG

Link to comment
  • Recently Browsing   0 members

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