Jump to content

nyxudf

Members
  • Posts

    10
  • Joined

  • Last visited

Details

  • Gang
    UDF

Recent Profile Visitors

340 profile views

nyxudf's Achievements

Member

Member (5/54)

0

Reputation

  1. No sé a cuál te refieres pero creo que este es similar a lo que necesitas: backfire
  2. 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.
  3. Una disculpa de antemano por revivir este post viejo pero me entró la curiosidad de saber cómo se podría ocultar el nametag propio del jugador, o sea, que el jugador solo pueda ver el de los demás y no el propio. Gracias xD
  4. <catalog type="vehicle"> <group name="Bicicletas Y Motos"> <group name="Motos"> <vehicle id="581" name="Honda XRE 300" /> <vehicle id="462" name="Faggio" /> <vehicle id="521" name="Yamaha" /> <vehicle id="463" name="Freeway" /> <vehicle id="523" name="HPV1000" /> <vehicle id="522" name="NRG-500" /> <vehicle id="461" name="PCJ-600" /> <vehicle id="448" name="Pizza Boy" /> <vehicle id="468" name="Sanchez" /> <vehicle id="586" name="Wayfarer" /> <vehicle id="471" name="Quadbike" /> </group> </group> <group name="Bicis"> <vehicle id="509" name="Bike" /> <vehicle id="481" name="BMX" /> <vehicle id="510" name="Mountain bike" /> </group> </group> <group name="Autos Argentinos"> <group name="Autos"> <vehicle id="602" name="Suzuki Wtift GTi" /> <vehicle id="429" name="Lamborghini Huracan v10" /> <vehicle id="402" name="Audi S4" /> <vehicle id="480" name="Fiat Tempra" /> <vehicle id="562" name="Renault Sandero RS" /> <vehicle id="587" name="Volkswagen Golf Mk3" /> <vehicle id="565" name="Toyota Corolla AE86" /> <vehicle id="559" name="Chevrolet Corsa Hatch" /> <vehicle id="560" name="Volkswagen Gol G3" /> <vehicle id="558" name="Volkswagen Gol G6n" /> <vehicle id="536" name="Peugeot 206" /> <vehicle id="419" name="Peugeot 207 RC" /> <vehicle id="496" name="Blista Compact" /> <vehicle id="401" name="Citroen DS3" /> <vehicle id="527" name="Fiat 128" /> <vehicle id="533" name="Fiat 147 Sorpasso" /> <vehicle id="526" name="Fortune" /> <vehicle id="517" name="Renault Clio Sport" /> <vehicle id="410" name="Honda Civic Si" /> <vehicle id="436" name="Mercedes Benz 190E" /> <vehicle id="475" name="Citroen C4 VTS" /> <vehicle id="439" name="Peugeot 206 HDi" /> <vehicle id="549" name="Volkswagen Beetle Clasico" /> <vehicle id="445" name="Chevrolet Vectra 2.0" /> <vehicle id="438" name="Volkswagen Gol G4" /> <vehicle id="585" name="Duna" /> <vehicle id="466" name="Chevrolet Cruze 2011" /> <vehicle id="492" name="Chevrolet Corsa" /> <vehicle id="546" name="Chevrolet Celta" /> <vehicle id="551" name="BMW M5 E34" /> <vehicle id="516" name="Volkswagen Jetta Mk2" /> <vehicle id="467" name="Volkswagen Gol G1 GTi" /> <vehicle id="426" name="Toyota Corolla" /> <vehicle id="547" name="Volkswagen Santana" /> <vehicle id="405" name="Hyundai Sonata" /> <vehicle id="550" name="Audi A6 2004" /> <vehicle id="566" name="Peugeot 504" /> <vehicle id="420" name="Volkswagen Voyage G7" /> <vehicle id="540" name="Mercedes Benz Clase S" /> <vehicle id="421" name="Fiat Uno" /> <vehicle id="529" name="Audi RS5" /> <vehicle id="499" name="Camion Mitsubishi" /> <vehicle id="609" name="Black Boxville" /> <vehicle id="422" name="Volkswagen Saveiro G4" /> <vehicle id="543" name="Volkswagen Saveiro G1" /> <vehicle id="554" name="Chevrolet Silverado" /> <vehicle id="589" name="Volkswagen Golf Mk2" /> <vehicle id="404" name="Renault 9" /> <vehicle id="479" name="Audi A4 Avant" /> <vehicle id="561" name="Audi A4 Avant" /> </group> </group> <group name="Autos de Policia"> <group name="Policia"> <vehicle id="596" name="Auto de Policia" /> </group> </catalog>
  5. Buenas gente, necesito saber si ¿existe alguna función que permita identificar si un jugador que está dentro de un vehículo es el conductor o el pasajero? Si es así ¿cuál es? Por favor. Gracias ?
  6. Lo probé y funcionó, muchas gracias.
  7. Ya lo he intentado de las 2 formas y ocurre lo mismo
  8. Hola a todos, he descargado el script "Vehicle BombShop (bombshopadv)" y al momento de darle a start me sale el siguiente error: "ERROR: Loading script failed: bombshopadv/bombshop.lua:1: unexpected symbol near '?' Quisiera saber ¿por qué ocurre esto? Antes yo podía usarlo... Gracias.
×
×
  • Create New...