Jump to content

nametag ped


BorderLine

Recommended Posts

hi forum

well i was mading

a nametag for peds

but dont work

i dont know where is the error

debug dont show errors

  
local sx,sy = guiGetScreenSize() 
  
function drawPedTags() 
    for i,v in ipairs(getElementsByType("ped")) do 
        local name = getElementData(v,"name") 
        if name then 
            local x,y,z = getElementPosition(v) 
            local cx,cy,cz = getCameraMatrix() 
            local r,g,b      = getPlayerNametagColor(attached) 
            local nameLength = dxGetTextWidth(pname,textScale,textFont) 
            if isLineOfSightClear(cx,cy,cz,x,y,z,true,true,false,true,false,true,false,v) then 
                if getDistanceBetweenPoints3D(cx,cy,cz,x,y,z) <= 45 then 
                    local px,py = getScreenFromWorldPosition(x,y,z+0.3,0.06) 
                    if px then 
                        local hp = getElementHealth(v) 
                        if hp > 0 then 
                            local width = dxGetTextWidth(name,1,default) 
  
                            dxDrawColorText(name, px + 1, py + 1, px + 1, py + 1, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) 
                            dxDrawColorText(name, px, py, px, py, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) 
                        end 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler("onClientRender",getRootElement(),drawPedTags) 
  

thanks so much

Link to comment
local sx,sy = guiGetScreenSize() 
  
function drawPedTags() 
    for i,v in ipairs(getElementsByType("ped")) do 
        local name = getElementData(v,"name") 
        if name then 
            local x,y,z = getElementPosition(v) 
            local cx,cy,cz = getCameraMatrix() 
            local r,g,b      = 0,255,0 
            local nameLength = dxGetTextWidth(name,textScale,textFont) 
            if isLineOfSightClear(cx,cy,cz,x,y,z,true,true,false,true,false,true,false,v) then 
                if getDistanceBetweenPoints3D(cx,cy,cz,x,y,z) <= 45 then 
                    local px,py = getScreenFromWorldPosition(x,y,z+0.3,0.06) 
                    if px then 
                        local hp = getElementHealth(v) 
                        if hp > 0 then 
                            local width = dxGetTextWidth(name,1,default) 
  
                            dxDrawColorText(name, px + 1, py + 1, px + 1, py + 1, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) 
                            dxDrawColorText(name, px, py, px, py, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) 
                        end 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler("onClientRender",getRootElement(),drawPedTags) 

The code seems familiar, I'm pretty sure you didn't script this.

Link to comment
So, you steal scripts from other servers? are you f**** kidding me? we don't help people who steal scripts!

Yeah, played his server, got me bored 2 minutes of playing it, left it.

Just weapons + player skins from RE4. Absolutely no code is fully made by himself, as I can see.

And still cannot get why people like this server; it's really boring (not just because he stole scripts, it's SERIOUSLY boring). People is stupid :(

@Jaysds1: There is no need to say you are kinda pro (and you're not even "kinda", you're like medium-low xD)

Link to comment
So, you steal scripts from other servers? are you f**** kidding me? we don't help people who steal scripts!

Yeah, played his server, got me bored 2 minutes of playing it, left it.

Just weapons + player skins from RE4. Absolutely no code is fully made by himself, as I can see.

And still cannot get why people like this server; it's really boring (not just because he stole scripts, it's SERIOUSLY boring). People is stupid :(

@Jaysds1: There is no need to say you are kinda pro (and you're not even "kinda", you're like medium-low xD)

you are right. but people that want

new things.. not same skin of gta , or same weapons.

close topic please.. this is offtopic

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