Jump to content

Chaky

Members
  • Posts

    61
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Chaky's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. hola aqui dejo una imagen de lo que me sale realmente entiendo ayuda porfavor http://es.tinypic.com/r/34g6lue/8
  2. hola a todos bueno tengo un pequeño problema como dice el titulo con el nametag pasa que lo activo y aparecen los nombres arriba de los usuarios pero despues de unos minutos el nombre desaparece agredeceria su ayuda aca les dejo el codigo addEventHandler("onClientRender", getRootElement(), function() for k,player in ipairs(getElementsByType("player")) do if getElementHealth(player) >= 1 then local width, height = guiGetScreenSize () local lx, ly, lz = getWorldFromScreenPosition ( width/2, height/2, 10 ) setPedLookAt(player, lx, ly, lz) end end end) srfont = dxCreateFont("srfont.ttf",13) g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Players = getElementsByType('player') g_Me = getLocalPlayer() nametag = {} local nametags = {} sWidth,sHeight = guiGetScreenSize() local bHideNametags = false local NAMETAG_SCALE = 0.2 local NAMETAG_ALPHA_DISTANCE = 30 local NAMETAG_DISTANCE = 70 local NAMETAG_ALPHA = 255 local NAMETAG_TEXT_BAR_SPACE = 2 local NAMETAG_WIDTH = 40 local NAMETAG_HEIGHT = 4.2 local NAMETAG_TEXTSIZE = 0.18 local NAMETAG_OUTLINE_THICKNESS = 1.2 -- local NAMETAG_ALPHA_DIFF = NAMETAG_DISTANCE - NAMETAG_ALPHA_DISTANCE NAMETAG_SCALE = 1/NAMETAG_SCALE * 800 / sHeight -- Ensure the name tag doesn't get too big local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } -- Ensure the text doesn't get too small/unreadable local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } -- Make the text a bit brighter and fade more gradually local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametag.create ( player ) nametags[player] = true end function nametag.destroy ( player ) nametags[player] = nil end function Nametags() -- Hideous quick fix -- for i,player in ipairs(g_Players) do if isElement(player) then if player ~= g_Me then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametag.create ( player ) end end end end if bHideNametags 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(g_Me) then break end local px,py,pz = getElementPosition ( player ) if processLineOfSight(x, y, z, px, py, pz, true, false, false, true, false, true) then break end local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then --Get screenposition local sx1,sy = getScreenFromWorldPosition ( px, py, pz+1, 1 ) local sx,sy = getScreenFromWorldPosition ( px, py, pz+1, 1 ) if not sx or not sy then break end --Calculate our components local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local scale2 = 8/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) local DSTRN = 255 local r,g,b = getPlayerNametagColor(player) local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 local offset3 = (scale) * NAMETAG_TEXT_BAR_SPACE/2.1 local offset2 = (scale) * NAMETAG_TEXT_BAR_SPACE/0.32 local w = dxGetTextWidth(getPlayerNameR(player), textscale * NAMETAG_TEXTSIZE, srfont) / 2 local w2 = dxGetTextWidth(getPlayerNameR(player), textscale * NAMETAG_TEXTSIZE, srfont) / 2.025 local lvl = getElementData(player,"level") dxDrawImage(sx + 6* scale, sy - 18 * scale, scale * 10, scale * 10, ":DSTRSystem/IMG/rangos/0.png", 0, 0, 0, tocolor(255, 255, 255,getElementAlpha(player)),false) dxDrawColorText("[ ]\n"..getPlayerNameR(player).."", sx - w2, sy - offset3, sx, sy - offset, tocolor(0, 0, 0, getElementAlpha(player)), textscale * NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false, false) dxDrawText("[ ]\n"..getPlayerName(player).."", sx, sy - offset, sx, sy - offset, tocolor(r, g, b, getElementAlpha(player)), textscale * NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false, true) local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset drawY2 = sy + offset2 drawnY = drawY + 15 local width, height = NAMETAG_WIDTH * scale, NAMETAG_HEIGHT * scale --Next the inner background local team = getPlayerTeam(player) if (team) then r, g, b = getTeamColor( team ) else r, g, b = getPlayerNametagColor(player) end health = getElementHealth ( player ) health = math.max(health, 0)/100 local alphad = getElementAlpha(player) armor = getPedArmor( player ) armor = math.max(armor, 0)/100 dxDrawImageSection(drawX, drawY, width, height, math.floor(256 - 256 * health), 0, 256, 16, "h1.png", 0, 0, 0, tocolor(r, g, b, alphad)) dxDrawImageSection(drawX, drawY, width, height, math.floor(256 - 256 * health), 0, 256, 16, "h2.png", 0, 0, 0, tocolor(255, 255, 255, alphad)) dxDrawImage(drawX - 1, drawY + 0.8, width + 2, height, "h3.png", 0, 0, 0, tocolor(255, 255, 255,alphad),false) if armor <= 0 then else dxDrawImageSection(drawX, drawY2, width, height, math.floor(256 - 256 * armor), 0, 256, 16, "h1.png", 0, 0, 0, tocolor(110, 110,110, alphad)) dxDrawImageSection(drawX, drawY2, width, height, math.floor(256 - 256 * armor), 0, 256, 16, "h2.png", 0, 0, 0, tocolor(255, 255, 255, alphad)) dxDrawImage(drawX - 1, drawY2 +0.8, width + 2, height, "h3.png", 0, 0, 0, tocolor(255, 255, 255,alphad),false) end --Armor Bar --dxDrawImage(drawX, drawnY, virus * width, height, "images/bar.png", 0, 0, 0, tocolor(0,255,0,255), false) --dxDrawImage(drawX, drawnY, width, height, "images/bas.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) --dxDrawImage(drawX, drawnY, width, height, "images/bas2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end break end end end addEventHandler ( "onClientRender", g_Root, Nametags) function nametagsChanger () enabled = not enabled; if enabled then removeEventHandler("onClientRender", getRootElement(), Inf) removeEventHandler("onClientRender", getRootElement(), Nametags) else addEventHandler("onClientRender", getRootElement(), Inf) addEventHandler("onClientRender", getRootElement(), Nametags) end end bindKey( "F4", "up", nametagsChanger ) ---------------THE FOLLOWING IS THE MANAGEMENT OF NAMETAGS----------------- addEventHandler('onClientResourceStart', g_ResRoot, function() for i,player in ipairs(getElementsByType"player") do if player ~= g_Me then nametag.create ( player ) end end end ) addEventHandler ( "onClientPlayerJoin", g_Root, function() if source == g_Me then return end setPlayerNametagShowing ( source, false ) nametag.create ( source ) end ) addEventHandler ( "onClientPlayerQuit", g_Root, function() nametag.destroy ( source ) end ) -- Math functions function math.lerp(from,to,alpha) return from + (to-from) * alpha end -- curve is { {x1, y1}, {x2, y2}, {x3, y3} ... } function math.evalCurve( curve, input ) -- First value if input<curve[1][1] then return curve[1][2] end -- Interp value 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] -- Find pos between input points local alpha = (input - x1)/(x2 - x1); -- Map to output points return math.lerp(y1,y2,alpha) end end -- Last value return curve[#curve][2] end function removeColorCoding ( name ) return type(name)=='string' and string.gsub ( name, '#%x%x%x%x%x%x', '' ) or name end function getPlayerNameR ( player ) return removeColorCoding ( getPlayerName ( player ) ) 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 addEventHandler("onClientResourceStart", resourceRoot, function () setPedTargetingMarkerEnabled(false) end )
  3. Hola miren tengo un problema con mi globalchat en mi servidor Dayz al loguear no se puede usar almenos que se reinicie el script la verdad ya trate y no se que este agradeceria todo tipo de ayuda aca les dejo el script function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#ff0000*[ADMIN]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#000fff*[sMOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then outputChatBox("#ffff00*[VIP]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#00ff00*[MOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else outputChatBox("#123456[Global]#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end end addCommandHandler("global", globalMessage); addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global"); end end)
  4. Nuevo servidor MtaDayz Bueno chicos les vengo a presentar un nuevo servidor que recién iniciamos unos amigos y yo Bueno nuestro servidor encontraras Skins nuevos Sonidos de Armas Reales, sonidos del ambiente nuevos Gran variedad de autos Eventos diarios staffs amables y mucho mas que esperan para ingresar al servidor denle una oportunidad recién comenzamos Host 24/7 0 Lag ip mtasa://23.94.249.243:42450
  5. Bueno chicos ando pensando hacer un servidor rolplay pero realmente no se nada del tema que gamemode debería usar ? y quisiera que ustedes me brindaran algunos consejos
  6. ._. no entendiagrego esas funciones al script normal ?
  7. Bueno ya se hacer puertas por comandos pero mi duda es como hacer para hacer un elevador que suba y baje por medio de un comando agradesco toda ayuda
  8. buenas chicos ya van varias veces que eh tratado pero resulta que nunca se traduce o se buguea el modo si alguien me ayudara dándome algunos consejos o diciéndome en que archivos se traduce se los agradecería demaciado
  9. Bueno chicos mi idea es esta crear un Ped con un anuncio que diga "vendedor de armas" y al acercarse que apareca el panel de venta de armas nose si ya lo a creado alguien sinceramente pero si me pueden ayudar diciéndome que funciones puedo usar se los agradecería mucho
  10. Si ya añadi la linea al Grupo admin en el ACL
  11. Bueno tengo un script que lo que hace es que cuando el usuario diga lo mismo 2 veces seguidas automáticamente se le mutea para ello antes aparece un anuncio ante todo el server por medio del chat el cual dice que el servidor muteo al usuario el anuncio aparece y el script aparenta andar bien pero el problema es que no se mutea el user el usuario puede seguir usando el chat de forma normal aca les dejo el script antiSpam = {} function antiChatSpam(play) if isTimer(antiSpam[source]) then cancelEvent() outputDebugString ("Servidor GPX Muteo Al Usuario"..getPlayerName(source).." 5 Min Por PENDEJO") outputChatBox("Servidor GPX Muteo Al Usuario "..getPlayerName(source).." 5 Min Por PENDEJO", getRootElement(), 255, 0, 0,true) setPlayerMuted(source, true) setTimer ( autoUnmute, 60000, 1, source) else antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) end end addEventHandler("onPlayerChat", root, antiChatSpam) function autoUnmute ( player ) if ( isElement ( player ) and isPlayerMuted ( player ) ) then setPlayerMuted ( player, false ) outputChatBox (""..getPlayerName ( player ).." Fue Desmuteado (Fin del Mute)",getRootElement(), 0, 255, 9,true ) end end
  12. local randomSpawnTable = { { -1970.82886, 661.22388, 46.57,}, { -1931.52368, 668.14990, 46.57 } } function Bot2 ( ) local random = math.random ( #randomSpawnTable ) local x, y, z = unpack ( randomSpawnTable [ random ] ) Nemesis = exports [ "slothbot" ]:spawnBot ( x, y, z, 90, math.random ( 2,2 ), 0, 0, Boss, 38, hunting, true ) exports.extra_health:setElementExtraHealth ( Nemesis, 9999999 ) outputChatBox ( "Nemesis: STAARRS!!!!!!!!!" ) local myBlip2 = createBlipAttachedTo ( Nemesis, 56 ) end addEventHandler ( "onResourceStart", resourceRoot, Bot2 ) addEvent("onBotWasted", true) addEventHandler("onBotWasted", root, function() if (source == Nemesis) then setTimer(Bot2, 3600000, 1) local attached = getAttachedElements ( source ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end end)
  13. Bueno miren el problema es simple pero no entiendo por que pasa tengo un script de BOOS de la comunidad por defecto trae 5K de blood el boos pero yo quiero ponerle mas ya que realmente es facil matarlo pero al momento de editar la vida del boss aparenta estar todo bien guardo procedo a iniciar el script en el servidor voy a buscar al boss y sale qe rapidamente los mato aun asi .-. alguna idea de que pasa Gracias y saludos C:
  14. la segunda de las horas de juego me tira error alguna idea ya intente y no anda :c
  15. pero yo tamien quiero agregar que salga el dinero horas jugadas FPS
×
×
  • Create New...