Jump to content

SpoC^

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by SpoC^

  1. @Walid Look my intention for border, Transparency on the map edge on GPS
  2. What a mess. this function did not change anything dxSetTextureEdge( radarRT2, "border", tocolor( 255, 255, 255, 100 ) )
  3. Look complete function function renderRadar() if not radarRT1 and radarRT2 then return end dxDrawImage(70*sW, 697*sH, 236*sW, 9*sH, "sz/blips/radarbg.png", 0, 0, 0, tocolor(0, 0, 0, RBACK_ALPHA)) ---------------------------------------------------------------------------- local vehicle = getPedOccupiedVehicle (localPlayer) if isPedInVehicle(localPlayer) then local vx,vy,vz = getElementVelocity(vehicle) velocidade = ( 1 + (vx^2 + vy^2 + vz^2)^(0.5) ) / 2 else local vx,vy,vz = getElementVelocity(localPlayer) velocidade = math.max(1 + (vx^2 + vy^2 + vz^2)^(0.5), 2)/5 end local alt = MAP_SIZE * math.min(velocidade,2) - 80 dxDrawImageSection(0, 0, rtSX, rtSY, uvX, uvY, uvSX, uvSY, MAP_PATH) ---------------------------------------------------------------------------- local aPercent = math.abs(getTickCount()%1000 - 500) / 500 for k, Rarea in ipairs( getElementsByType("radararea") ) do if isElementVisible(Rarea) then local r, g, b, a = getRadarAreaColor(Rarea) local x, y, _ = getElementPosition(Rarea) local sx, sy = getRadarAreaSize(Rarea) local rx, ry = getImagePointFromWorld(x, y) local rsx, rsy = sx * MAP_MPP, -sy * MAP_MPP if isRadarAreaFlashing(Rarea) then a = a * aPercent end dxDrawRectangle(rx-uvX, ry-uvY, rsx, rsy, tocolor(r, g, b, a)) end end dxSetRenderTarget(radarRT1, true) dxDrawImage(0, 0, rtSX, rtSY, radarRT2, crot) dxSetBlendMode("blend") dxSetRenderTarget() dxDrawImageSection(RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, rtSX/2-RADAR_SX/2, rtSY/2-RADAR_SY/2, RADAR_SX, RADAR_SY, radarRT1, 0, 0, 0, tocolor(255, 255, 255, 11)) dxDrawImageBorder (RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, tocolor(0,0,0,255) ,2,false) -- My code function dxDrawImageBorder (corX, corY, imageWidth, imageHeight, lineColor, lineWidth, postGUI ) local lineWidth = lineWidth or 1 dxDrawLine ( corX, corY, corX+imageWidth, corY, lineColor, lineWidth, postGUI ) dxDrawLine ( corX, corY, corX, corY+imageHeight, lineColor, lineWidth, postGUI ) dxDrawLine ( corX, corY+imageHeight, corX+imageWidth, corY+imageHeight, lineColor, lineWidth, postGUI ) return dxDrawLine ( corX+imageWidth, corY, corX+imageWidth, corY+imageHeight, lineColor, lineWidth, postGUI ) end --hud health Armour --dxDrawRectangle(sW*67, sH*695, sW*241, sH*13, tocolor(0, 0, 0, 100), false) local sz1, sz2, sz3 = getHealthColor() local health = math.floor( getElementHealth( getLocalPlayer() )) if ( health <= 50) then HP_Colour = tocolor(sz1, sz2, sz3, textAlpha) HP_Alpha = tocolor(sz1, sz2, sz3, 100) else HP_Colour = tocolor(103, 188, 107, 255) HP_Alpha = tocolor(103, 188, 107, 100) end local stat = getPedStat ( getLocalPlayer(), 24 ) if stat < 1000 then dxDrawRectangle(sW*71, sH*698, sW*116, sH*7, HP_Alpha, false) --fundo dxDrawRectangle(sW*71, sH*698, sW*116/100*health, sH*7, HP_Colour, false) else dxDrawRectangle(sW*72, sH*698, sW*115, sH*7, HP_Alpha, false) --fundo dxDrawRectangle(sW*72, sH*698, sW*115/200*health, sH*7, HP_Colour, false) end if fadeIn == false then textAlpha = textAlpha - 7 elseif fadeIn == true then textAlpha = textAlpha + 7 end checkApha() local armour = getPedArmor ( getLocalPlayer() ) dxDrawRectangle(sW*190, sH*698, sW*55, sH*7, tocolor(95, 165, 206, 100), false) if armour>0 then dxDrawRectangle(sW*190, sH*698, sW*55/100*armour, sH*7, tocolor(95, 165, 206, 255), false) end local oxigenio= getPedOxygenLevel ( getLocalPlayer() ) dxDrawRectangle(sW*248, sH*698, sW*56, sH*7, tocolor(253, 219, 36, 140), false) if oxigenio < 1000 or isElementInWater (getLocalPlayer()) then dxDrawRectangle(sW*248, sH*698, sW*55, sH*7, tocolor(61, 94, 112, 255), false) dxDrawRectangle(sW*248, sH*698, sW*55/1000*oxigenio, sH*7, tocolor(169, 222, 246, 255), false) end addEventHandler("onClientRender", root, renderRadar)
  4. function renderRadar() if not radarRT1 and radarRT2 then return end dxDrawImage(70*sW, 697*sH, 236*sW, 9*sH, "sz/blips/radarbg.png", 0, 0, 0, tocolor(0, 0, 0, RBACK_ALPHA)) local aPercent = math.abs(getTickCount()%1000 - 500) / 500 for k, Rarea in ipairs( getElementsByType("radararea") ) do if isElementVisible(Rarea) then local r, g, b, a = getRadarAreaColor(Rarea) local x, y, _ = getElementPosition(Rarea) local sx, sy = getRadarAreaSize(Rarea) local rx, ry = getImagePointFromWorld(x, y) local rsx, rsy = sx * MAP_MPP, -sy * MAP_MPP if isRadarAreaFlashing(Rarea) then a = a * aPercent end dxDrawRectangle(rx-uvX, ry-uvY, rsx, rsy, tocolor(r, g, b, a)) end end dxSetRenderTarget(radarRT1, true) dxDrawImage(0, 0, rtSX, rtSY, radarRT2, crot) -- Your code dxSetBlendMode("blend") dxSetRenderTarget() dxDrawImageSection(RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, rtSX/2-RADAR_SX/2, rtSY/2-RADAR_SY/2, RADAR_SX, RADAR_SY, radarRT1, 0, 0, 0, tocolor(255, 255, 255, 11)) dxDrawImageBorder (RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, tocolor(0,0,0,255) ,2,false) -- My code function dxDrawImageBorder (corX, corY, imageWidth, imageHeight, lineColor, lineWidth, postGUI ) local lineWidth = lineWidth or 1 dxDrawLine ( corX, corY, corX+imageWidth, corY, lineColor, lineWidth, postGUI ) dxDrawLine ( corX, corY, corX, corY+imageHeight, lineColor, lineWidth, postGUI ) dxDrawLine ( corX, corY+imageHeight, corX+imageWidth, corY+imageHeight, lineColor, lineWidth, postGUI ) return dxDrawLine ( corX+imageWidth, corY, corX+imageWidth, corY+imageHeight, lineColor, lineWidth, postGUI ) end
  5. this is the map code dxSetBlendMode("blend") dxSetRenderTarget() dxDrawImageSection(RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, rtSX/2-RADAR_SX/2, rtSY/2-RADAR_SY/2, RADAR_SX, RADAR_SY, radarRT1, 0, 0, 0, tocolor(255, 255, 255, 11))
  6. If you've 'developed' a functional GTA V Radar with blips and radar areas, then you shouldn't have problems to use such an easy function like this one is. You are diverting the focus of my topic. "get help"
  7. Hello friends, I developed the radar style GTA V, I want placing map's edges GPS, equal to GTA V, transparency at the edges, someone dares to help? .lua dxSetBlendMode("blend") dxSetRenderTarget() dxDrawImageSection(RADAR_X-10, RADAR_Y-10, RADAR_SX+20, RADAR_SY+20, rtSX/2-RADAR_SX/2, rtSY/2-RADAR_SY/2, RADAR_SX, RADAR_SY, radarRT1, 0, 0, 0, tocolor(255, 255, 255, 11)) MTA:SA - My work GTA V - My intention
  8. @Solidsnake14 corrected, but did not understand much what you said, can help-me?
  9. I tried this, more not work. what will the error? Client.lua function user_tag2 () local cx, cy, cz, lx, ly, lz = getCameraMatrix() if(getElementData(localPlayer, "special.event")) then drawDistance = eventDrawDistance else drawDistance = normalDrawDistance end local target = getPedTarget(localPlayer) for k, player in pairs(getElementsByType("player", root, true)) do if(player ~= localPlayer or getElementData(player, "isgod")) then local vx, vy, vz = getPedBonePosition(player, 5 ) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz ) if dist < drawDistance or player == target then if( isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) ) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.3) if(x and y) then local tag = getElementData(player, "gang.tag") or "" local name = (tag .. getPlayerName(player)) .. "" .. (getElementData(player, "") or "") .. "" local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local color = tocolor(getPlayerNametagColor(player)) -- text add to ACL group (admin) dxDrawText("STAFF", x - 1 - w / 15,y - 55 - h - 1, w, h, tocolor(0,0,0), 0.9, "default-bold") dxDrawText("STAFF", x - 1 - w / 15,y - 56 - h - 1, w, h, tocolor(233, 137, 136, 255), 0.9, "default-bold") dxDrawText("ADMINS", x - 1 - w / 15,y - 45+3 - h - 1, w, h, tocolor(0, 0, 0, 255), 1.0, "default-bold") dxDrawText("ADMINS", x - 1 - w / 15,y - 46+3 - h - 1, w, h, tocolor(255, 255, 255, 255), 1.0, "default-bold") end end end end end end addEvent("Tag",true) addEventHandler("Tag", root, user_tag2) Server.lua function user_tag (player) if not isElement(player) then return end local account = getPlayerAccount (player) if not isGuestAccount ( account ) then local accName = getAccountName(account) if accName == "Console" then triggerClientEvent(player,"Tag",player) end end addEventHandler ( "onResourceStart" , resourceRoot, user_tag )
  10. this helped me a lot, thank very much CCW now I can play online in local server, with my friends
  11. Hello friends, This script does not allow Nick to appear with color in the chat. I want the Nick to appear with the color that the player chose when he talks ... -- Example --Client --Add the resource as addon to DayZ function addAddonInfo ( name, description ) return call ( getResourceFromName( "DayZ" ), "addAddonInfo", name, description ) end addAddonInfo ( "GlobalChat", "" ) -------------------------------------------------------------------- --Your Code --Please edit the settings in the meta.xml or admin panel instead of changing those colorCodesDefault = { } colorCodesDefault.colorcode1 = "#AD505C" colorCodesDefault.colorcode3 = "#AD505C" colorCodesDefault.colorcode2 = "#DBD7D7" colorCodes = { } colorCodes.colorcode1 = get ( "colorcode1" ) or colorCodesDefault.colorcode1 colorCodes.colorcode2 = get ( "colorcode2" ) or colorCodesDefault.colorcode2 colorCodes.colorcode3 = get ( "colorcode3" ) or colorCodesDefault.colorcode3 --Check color code on start for i, v in pairs ( colorCodes ) do if not getColorFromString ( v ) then colorCodes[i] = colorCodesDefault[i] --if the admin fails to enter a valid hex color code outputChatBox ( "Bad " .. i .. " specified at GlobalChat addon (format: #FFFFFF)", root, 255, 0, 0, false) outputDebugString ( "Bad " .. i .. " specified at GlobalChat addon (format: #FFFFFF)", 2 ) end end outputLimit = 128 --character limit for chatbox outputs (do not change this) messagePrefix = get ( "prefix" ) or "[GLOBAL]" --prefix for the outputs timeBetweenMessages = tonumber ( get ( "messagedelay" ) ) or 1000 --time to wait between chat messages playerTickTable = { } --create a table with tick counts of the most recent chat message --The message output function playeGlobalChat ( playersource, cmd, ... ) if cmd == "globalchat" then --Check whether the player is muted first if isPlayerMuted ( playersource ) then outputChatBox("You are muted!", playersource, 255, 128, 22, true) return end local msg = table.concat ( {...} , " " ) --concat the arguments from table to a string seperated by spaces local msg = string.gsub ( msg, '#%x%x%x%x%x%x', '' ) --remove color-codes --Anti-spam checks local onlyLettersMsg = string.gsub ( msg , "%A", "" ) --extract letters only if onlyLettersMsg == string.upper ( onlyLettersMsg ) and #onlyLettersMsg > 6 then --check if there are more than 6 uppercase letters without any lowercase letters outputChatBox ( "Desative o capslock!", playersource, 255, 0, 0 ) return end if string.find ( msg, "traveco" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Chingar players agora eh ban, pense duas vezes!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "puta" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Chingar players agora eh ban, pense duas vezes!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "biscate" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Chingar players agora eh ban, pense duas vezes!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "vagabunda" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Chingar players agora eh ban, pense duas vezes!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "buceta" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Proibido usar palavras informais, grato!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "invadi" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Proibido ameacar, se insistir vai levar ban!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "invadir" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Proibido ameacar, se insistir vai levar ban!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "fuder" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Chingar players agora eh ban, pense duas vezes!", playersource, 255, 0, 0, true ) return end if string.find ( msg, "lixo" ) then --disallow links return end if string.find ( msg, "abuser" ) then --disallow links outputChatBox ( "#FFFFFF[iNFO]:#ff0000 Para relatar abuso de admins, use a tecla 'O'.", playersource, 255, 0, 0, true ) return end if string.find ( msg, "http://" ) then --disallow links outputChatBox ( "Do not spam the chat with links. Please use a private message instead!", playersource, 255, 0, 0 ) return end --disabled the following filter as it might cause problems with russian, chinese and other special language characters --you can still re-enable it if you want latin characters only in your chat --[[local onlySpecCharMsg = string.gsub( msg, "[%a%d]", "") --extract special chars only if #onlySpecCharMsg > 15 then --check if there are more than 10 special characters used outputChatBox ( "Do not spam the chat with special characters!", playersource, 255, 0, 0 ) return end]] local var, spacesCount = string.gsub( msg, " ", "") --get the count of spaces if ( #msg / spacesCount ) > 20 and #msg > 20 then --check if there is at least one space per 20 or less characters outputChatBox ( "Do not spam the chat with long words!", playersource, 255, 0, 0 ) return end if playerTickTable[playersource] then --check if a table entry for the player exists local tick = getTickCount ( ) --get the current tick count in ms local timePassed = tick - playerTickTable[playersource] --calculate the time that passed between two messages if timePassed <= timeBetweenMessages then outputChatBox ( "Please refrain from chat spam!", playersource, 255, 0, 0 ) return end else playerTickTable[playersource] = getTickCount ( ) end --End of anti-spam checks local message = messagePrefix .. colorCodes.colorcode2 .. string.gsub ( ( getPlayerName ( playersource ) .. " : " ), '#%x%x%x%x%x%x', '' ) .. colorCodes.colorcode3 .. msg --precreate the message string local message = string.sub ( message, 1, outputLimit ) --since the chatbox won't display messages with more than 128 characters we just drop the ones at the end local r, g, b = getColorFromString ( colorCodes.colorcode1 ) outputChatBox ( message, root, r, g, b, true ) playerTickTable[playersource] = getTickCount ( ) end end addCommandHandler ( "globalchat", playeGlobalChat ) --Admin panel resource settings checks addEventHandler ( "onSettingChange", root, function ( setting, oldValue, newValue ) local setting = gettok ( setting, 2, string.byte ( "." ) ) if setting == "colorcode1" or setting == "colorcode2" or setting == "colorcode3" then if getColorFromString ( fromJSON( newValue ) ) then --if the admin fails to enter a valid hex color code colorCodes[setting] = fromJSON( newValue ) else colorCodes[setting] = colorCodesDefault[setting] outputChatBox ( "Bad " .. setting .. " specified at GlobalChat addon (format: #FFFFFF)", root, 255, 0, 0, false) outputDebugString ( "Bad " .. setting .. " specified at GlobalChat addon (format: #FFFFFF)", 2 ) end end if setting == "messagedelay" then --update message delay when changed if tonumber ( fromJSON( newValue ) ) then timeBetweenMessages = tonumber ( fromJSON( newValue ) ) or 1000 --maximum securtiy is usually best end end if setting == "prefix" then --update message prefix when changed if fromJSON( newValue ) then messagePrefix = fromJSON ( newValue ) or "[GLOBAL]" --maximum securtiy is usually best end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) playerTickTable[source] = nil --remove a leaving player from our cached table end ) -- Meta "-ffs-Sniper" description="Advanced GlobalChat MTA:DayZ addon" version="1.0.1" type="script" />
  12. hello friends, wanted to add this function to the text in dx, but do not know import and export for server and client. I am new to the moon, and I am studying hard and learning gradually someone with a good heart can do for me? obs: sorry my english if (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playersource)), aclGetGroup("Admin"))) then function tagAdminStaff() local cx, cy, cz, lx, ly, lz = getCameraMatrix() if(getElementData(localPlayer, "special.event")) then drawDistance = eventDrawDistance else drawDistance = normalDrawDistance end local target = getPedTarget(localPlayer) for k, player in pairs(getElementsByType("player", root, true)) do if(player ~= localPlayer or getElementData(player, "isgod")) then local vx, vy, vz = getPedBonePosition(player, -- s8) --> local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz ) if dist < drawDistance or player == target then if( isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) ) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.3) if(x and y) then local tag = getElementData(player, "gang.tag") or "" local name = unfuck(tag .. getPlayerName(player)) .. "" .. (getElementData(player, "") or "") .. "" local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local color = tocolor(getPlayerNametagColor(player)) -- text add to ACL group (admin) dxDrawText("STAFF", x - 1 - w / 15,y - 55 - h - 1, w, h, tocolor(0,0,0), 0.9, "default-bold") dxDrawText("STAFF", x - 1 - w / 15,y - 56 - h - 1, w, h, tocolor(233, 137, 136, 255), 0.9, "default-bold") dxDrawText("ADMINS", x - 1 - w / 15,y - 45+3 - h - 1, w, h, tocolor(0, 0, 0, 255), 1.0, "default-bold") dxDrawText("ADMINS", x - 1 - w / 15,y - 46+3 - h - 1, w, h, tocolor(255, 255, 255, 255), 1.0, "default-bold") end end end end end end
  13. ALw7sH, worked perfectly !! function Protect1(element,dimens) "bug" tidy !! Note 10 for you my Friend
  14. The same happened to me, I believe that this will cause serious problems with some users ... I appeal to them to see the download links as they have something wrong al
  15. I need help, Can somebody help me friends?
  16. Neves768 , outputChatBox worked, less protection of the vehicle within the marking not working
×
×
  • Create New...