Jump to content

Search the Community

Showing results for tags 'nametag'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 13 results

  1. Hello everyone, I have a question about this script that I found in the community. It doesn't have any errors on startup, I just want to know how I could hide the local player's tag but keep others visible. Client side: myfont = "default-bold" nametags_Root = getRootElement() nametags_ResRoot = getResourceRootElement(getThisResource()) nametags_Players = getElementsByType('player') nametags_Me = getLocalPlayer() nametag = {} local nametags = {} local sWidth,sHeight = guiGetScreenSize() local Nametags_Hide = false local Nametags_Scale = 0.36 local Nametags_Alpha_Distance = 30 local Nametags_Distance = 40 local Nametags_Alpha = 255 local Nametags_Text_Bar_Space = 1 local Nametags_Width = 50 local Nametags_Height = 20 local Nametags_Size = 0.45 local Nametags_Outline_Thickness = 1.2 local Nametags_Alpha_Diff = Nametags_Distance - Nametags_Alpha_Distance Nametags_Scale = 1/Nametags_Scale * 800 / sHeight local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametags.Create ( player ) nametags[player] = true end function nametags.Destroy ( player ) nametags[player] = nil end addEventHandler ( "onClientRender", nametags_Root, function() if getElementData(getLocalPlayer(), "state.hud") == "disabled" then return end for i,player in ipairs(nametags_Players) do if isElement(player) then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametags.Create ( player ) end end end if Nametags_Hide then return end local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isElement(player) then break end if getElementDimension(player) ~= getElementDimension(nametags_Me) then break end local px,py,pz = getElementPosition ( player ) local bx, by, bz = getPedBonePosition( player, 5 ) if processLineOfSight(x, y, z, px, py, pz, true, false, false, true, false, true) then break end local playerDistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if playerDistance <= Nametags_Distance then --Get screen position local sx,sy = getScreenFromWorldPosition( bx + 0, by, bz + 0.4 ) if not sx or not sy then break end --Calculate our components local scale = 1/(Nametags_Scale * (playerDistance / Nametags_Distance)) local alpha = ((playerDistance - Nametags_Alpha_Distance) / Nametags_Alpha_Diff) alpha = (alpha < 0) and Nametags_Alpha or Nametags_Alpha-(alpha*Nametags_Alpha) scale = math.evalCurve(maxScaleCurve,scale) local textScale = math.evalCurve(textScaleCurve,scale) local textAlpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = Nametags_Outline_Thickness*(scale) --Requirements local team = getPlayerTeam(player) local level = getElementData(player, "LV") or 0 local Reputation = getElementData(player, "Reputation") or "player" local r,g,b = getPlayerNametagColor(player) local offset = (scale) * Nametags_Text_Bar_Space/2 local playerName = getPlayerName(player) local imageSize = dxGetFontHeight ( textScale*Nametags_Size, myfont ) local lp = getElementData(player, "experience.rank") or "Newbie" local bitt = interpolateBetween(40, 0, 0, 255, 0, 0, ((getTickCount()) / 1300), "SineCurve") local isim = getPlayerName(player):gsub('#%x%x%x%x%x%x', '') --Draw our text dxDrawText ( isim.."", sx + 0.5*scale, sy - offset + 0.5*scale, sx + 0.5*scale, sy - offset + 0.5*scale, tocolor(0,0,0,255), textScale*Nametags_Size*1., myfont, "center", "bottom", false, false, false, true, true ) dxDrawText ( playerName.."", sx, sy - offset, sx, sy - offset, tocolor(r,g,b,255), textScale*Nametags_Size*1., myfont, "center", "bottom", false, false, false, true, true ) nameWidth = dxGetTextWidth ( playerName.."", textScale*Nametags_Size, myfont ) teamWidth = nameWidth if Reputation then -- dxDrawImage ( sx - math.max(nameWidth/2, teamWidth/2) - 40*scale, sy - 2*imageSize, 7*imageSize, 2*imageSize, ""..Reputation..".png" ) end end break end end end ) function nametagsCreate() for i,player in ipairs(getElementsByType"player") do nametags.Create ( player ) nametags.Create ( localPlayer ) setElementData(player, "nametags", "enabled") end end addEventHandler('onClientResourceStart', nametags_Root, nametagsCreate) function nametagsCreateOnJoin() if source == nametags_Me then return end setPlayerNametagShowing ( source, false ) nametags.Create ( source ) end addEventHandler('onClientPlayerJoin', nametags_Root, nametagsCreateOnJoin) function nametagsDestroy() nametags.Destroy ( source ) end addEventHandler('onClientPlayerQuit', nametags_Root, nametagsDestroy) function math.lerp(from,to,alpha) return from + (to-from) * alpha end function math.evalCurve( curve, input ) if input<curve[1][1] then return curve[1][2] end for idx=2,#curve do if input<curve[idx][1] then local x1 = curve[idx-1][1] local y1 = curve[idx-1][2] local x2 = curve[idx][1] local y2 = curve[idx][2] local alpha = (input - x1)/(x2 - x1); return math.lerp(y1,y2,alpha) end end return curve[#curve][2] end function dxDrawColorText(str, ax, ay, bx, by, color, scale, font,alignX,alignY,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 s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) ax = ax + w color = tocolor(tonumber("0x"..string.sub(col, 1, 2)), tonumber("0x"..string.sub(col, 3, 4)), tonumber("0x"..string.sub(col, 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,alignX,alignY,clip, wordBreak, postGUI) end end Thanks.
  2. Eu queria deixar esse nome tag com a funçao de quando o staff digitasse um comando o nome dele sumisse junto com a vida e o colete. alguem poderia me ajudar? words = {} SQLS3D = { qury = executeSQLQuery } chatTime = {} lastChatMessage = {} addEventHandler("onPlayerChat", getRootElement(), function(text, msgtype, thePlayer) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local root = getRootElement() local id = getElementData(source, "ID") or "N/A" local name = getPlayerName(source) local r,g,b = getPlayerNametagColor(source) local Account1 = getPlayerAccount ( source ) local new = "" local iter = 0 msg = string.gsub(text,"ـ","") for word in msg:gmatch("%S+") do iter = iter + 1 -- for i,swr in ipairs(words) do -- local src = word:lower():gsub("%s","") -- local src = src:gsub("#%x%x%x%x%x%x","") -- local src = src:gsub("%c","") -- local src = src:gsub("%p","") -- local pat = swr:lower():gsub("%s","") -- if src:find(pat) then -- local replaceString = "" -- for x=1,word:gsub("#%x%x%x%x%x%x",""):len() do -- replaceString = replaceString.."*" -- end -- word = word:gsub(word,replaceString) -- end -- end if iter == 1 and word:len() > 0 then word = word:gsub("%a",string.upper,1) end new = new..word.." " end if new ~= "" then msg = new end text = msg if chatTime[source] and chatTime[source] + tonumber(1000) > getTickCount() then cancelEvent() outputChatBox("Espere 1 segundo para poder digitar novamente!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end lastChatMessage[source] = text local r, g, b = getPlayerNametagColor(source) cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00ff00Dona #ff0000Geral #2F2F2F⌟ #ffffff" .. name .. "#FFFFFF ("..id..") »#ffffff " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Subdono")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F ⌜ #00BFFFSub #ff0000Dono #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin geral")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00FFFFAdministrador #FFFAFAGeral #2F2F2F⌟ " .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ ⌟ #2F2F2F⌜ #FF0040Adminis#FFFFFFtrador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderador")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #9B30FFModer#FFFFFFador #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00ff00Super#2F2F2F Moderador ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Ajudante")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #7FFFD4Ajud#FFFFFFante #2F2F2F ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("vip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FF00FFVIP #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Versatil Drifting")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #2F2F2FVЄƦƧƛƬƖԼ #FF0040ƊƦƖƑƬƖƝƓ ⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tagdovip")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #FFFFFFV҉I҉P#363636-™ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("tdetag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #00BFFF✘ ŦŘØƤΔ ĐΔ €ŞĆØĆƗΔ ✘ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("cvtag")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧#2F2F2F⌜ #ff0000✞ ĆØΜΔŇĐØ V€ŘΜ€ŁĦØ ✞ #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox("#00ffff╠═⟦ #ffffffв#00ffff√#ffffffʟ#00ffff ⟧ #2F2F2F⌜ #00BFFFJoga#FFFFFFdor #2F2F2F⌟ #FFFFFF" .. name .."#FFFFFF ("..id..") »#FFFFFF" .. text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end end )
  3. local rootElement = getRootElement() local NPC = createPed(124,0,0,5) local screenWidth, screenHeight = guiGetScreenSize() function NPCnametag() local sx,sy = getScreenFromWorldPosition (getElementPosition(NPC)) if sx then dxDrawText("Bob",sx,sy,screenWidth, screenHeight,tocolor ( 255, 255, 0, 255 ), 2,"sans") end end function HandleTheRendering() addEventHandler("onClientRender",rootElement, NPCnametag) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering)
  4. Sziasztok írtam 1 scriptet ami nametag vagyis ha a karakter fölött mutatja a nevem akkor így "kellene" mutatnia ChrisT (Tulajdonos) De sajnos nem mutatja, mi lehet a baj? De nem jutottam semmire. Valaki nem tud 1-et adni?
  5. Hello everyone, i need help in script nametag - nickname with colors and without. Prints: WITHOUT COLORS IN NICK WITH COLORS IN NICK Code: dxDrawBorderedText(getPlayerName(player), x - w / 2 + 35, y - h + 6, w, h, tocolor(255,255,255,255), scale, font, "left", "top", false, false, false, true, false) Warning: I already used " :gsub("#%x%x%x%x%x%x", "")" it and it did not work, I already changed the "left" and "top" to "center", "center", and also did not work, help, please
  6. NAME-TAG (À VENDA) ❯Script de name-tag 100% em Dx e bonito disponível para compras. Vídeo de demonstração acima. ❯Compre acessando: https://goo.gl/KWcSqT
  7. I added this: to the nametag script.. but with 1-2 player working fine, and with more players, always show the chaticon.. How to fix this?
  8. ..this is not the full code from my nametag: when i press 'T', the chaticon appear on everybody.. how to fix this? i want, when a player, or me press 'T', the ballon show just on the player, or on me, not on everyplayers... sorry for my terrible english .. :c
  9. Hello I have a nametag script. And i have a chat-icon script too. But i want add the chat-icon thing to nametag script, above the player nametag. And do not appear for me, just another players. This is possible? If yes, how? Sorry for my bad english..
  10. How can ı see my nametag and hidden it with ''N'(bind)' ? http://s6.dosya.tc/server7/m28h8e/nametag.rar.html NAMETAG.LUA Please, do and share. my = 1 -->ı can see my nametag my = nil --> ı can not see
  11. i added this to a nametag script: dxDrawColorText (getElementHealth(player).."%", sx-w- (offset*-10), sy - (offset*5), sx, sy - (offset*-15), tocolor(255,255,255,255), textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont2, "center", "center", false, false, false ) and for example when long the playername, the "100%" move to left direction. How to fix this? sorry for my very-very bad English:c
  12. I want create a nametag script,but i don't know, how. How to place the dxdrawrectangle on my head?
  13. local teamname = (getTeamName(playerTeam) or "Player") Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean] The code have errors? -- Sorry bad english, i'm portuguese.
×
×
  • Create New...