Jump to content

Search the Community

Showing results for tags 'color'.

  • 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 12 results

  1. Galera to fazendo um sistema de painel q vc digita no painel tipo 255, 0, 0 dentro de um carro e seta a cor vermelha no carro q e do rgb 255, 0, 0 e etc. mas da forma que achei que era possivel ao abrir o painel e digitar a cor em rgb eu fiz uma função que na teoria era pra pegar oq foi digitado na editbox e setar oq foi digitado na editbox como cor do carro usando setVehicleColor so q n aparece nada e n seta cor no carro mais se o carro ta vermelho e coloca tipo 255, 0, 0 na editbox e da ok a cor sempre muda pra preto espero q de para entender function SetarCor (playerSource, getMsg) --local mensagem = tonumber(getMsg) local uVehicle = getPedOccupiedVehicle( playerSource ) if isPedInVehicle( playerSource ) then if uVehicle then -- if mensagem == "Vermelho" then setVehicleColor( uVehicle, tonumber(getMsg)) end end --end end addEvent("SetarCor", true) addEventHandler("SetarCor", getRootElement(), SetarCor) PARTE DO CLIENT function rgbtrigger (button, state) if painel == true then if button == "left" and state == "down" then if isCursorOnElement(screenW * 0.6384, screenH * 0.5885, screenW * 0.7379, screenH * 0.6185) then local getMsg = tostring(getElementData(msgstaff, "CMT_Txt")) removeEventHandler("onClientRender", root, dx) triggerServerEvent("SetarCor", getLocalPlayer(), localPlayer, getMsg) painel = false showCursor(false) end end end end addEventHandler("onClientClick", root, rgbtrigger)
  2. Is it possible to get all the guiStaticImages that have the specified color? I created a few guiStaticImages that are using a fully black png image. i was trying to do it this way, but it does not work.. for i, v in ipairs(getElementType("gui-staticimage")) do local color = guiGetProperty(v, "ImageColours") if color == "000000" then outputChatBox("lol") end end
  3. Hi, I've got an interesting bug with my localchat script. When the players are in range of local chat then for some of them a *action text* part is not colored, but when they're alone in their chat distance, everything works fine and message is fully colored. function RGBToHex(red, green, blue, alpha) -- Make sure RGB values passed to this function are correct if( ( red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 ) or ( alpha and ( alpha < 0 or alpha > 255 ) ) ) then return nil end -- Alpha check if alpha then return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) else return string.format("#%.2X%.2X%.2X", red, green, blue) end end function localchat (msg, msgtype, cmdname) local x, y, z = getElementPosition (source) local playerdim = getElementDimension (source) local range = 30 local playerName = getPlayerName (source) for index, player in pairs(getElementsByType ("player")) do local playersdim = getElementDimension (player) if playerdim == playersdim then local xp, yp, yz = getElementPosition (player) local distance = getDistanceBetweenPoints3D (x, y, z, xp, yp, yz) if ( distance <= range ) then r = tonumber (255 - (tonumber((distance))* 3)) g = tonumber (255 - (tonumber((distance))* 3)) b = tonumber (255 - (tonumber((distance))* 3)) mr = tonumber (255 - (tonumber((distance))* 3)) mg = 0 mb = tonumber (255 - (tonumber((distance))* 3)) if msgtype == 0 then cancelEvent() msg = string.gsub(msg, "#%x%x%x%x%x%x", "") msg = msg:gsub("^%l", string.upper) playerName = string.gsub(playerName, "#%x%x%x%x%x%x", "") playerName = string.gsub(playerName, "_", " ") mecolor = RGBToHex(mr, mg, mb) normalcolor = RGBToHex(r, g, b) while true do local find,find2 = string.find(msg, "%<(.-)%>") if (find and find2) then msg = string.sub(msg,1,find-1) .. mecolor .. "*".. string.sub(msg, find+1, find2-1) .. "*" .. normalcolor .. string.sub(msg, find2+1, #msg) else break end end if string.find(msg, ".", -1, true) or string.find(msg, "?", -1, true) or string.find(msg, "!", -1, true) then outputChatBox(playerName .. " mówi: " .. msg , player, r, g, b, true) else msg = msg.. "." outputChatBox(playerName .. " mówi: " .. msg , player, r, g, b, true) --outputChatBox(playerName .. " mówi: " .. msg .. ".", player, 255, 255, 255, true) end end end end end end addEventHandler("onPlayerChat", getRootElement(), localchat)
  4. i want change the needle color if speed >= 240, but does not working how to fix this? what wrong? no error(s)/warning(s)
  5. 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
  6. 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
  7. so there is this server called Grafuroam and it has a specific hydra skin for specific clan and not the same one for all clans and also everyone can SEE the texture i just want to know how to do this
  8. Всем привет, мб кто нибудь шарит в шейдерах. Вопрос следующего характера, необходимо покрасить наложенные на автомобиль четыре обьекта (колёса кастомные). Название текстуры у меня "body_k", написал саму систему, шейдер и при этом шейдер не очень хорошо понимает RGBA палитру. Только радикальные цвета будь то: 0,255,255,255; 255,0,0,255; 255,0,255 и т.д. При цвете например 75,0,255,255 выдает оттенок максимальный по заданым критериям, т.е. 255,0,255,255... Вот скриншот того, что пытаюсь реализовать:http://www.fotolink.su/pic_b/c03627c7d8665128f9c5ec7ecaf65c60.png (Не могу прикрепить почему-то изображение) Код шейдера: float4 gColor = float4(1,1,1,1); bool bIsGTADiffuse = true; //--------------------------------------------------------------------- // Include some common stuff //--------------------------------------------------------------------- #include "mta-helper.fx" //--------------------------------------------------------------------- // Sampler for the main texture //--------------------------------------------------------------------- sampler Sampler0 = sampler_state { Texture = (gTexture0); }; //--------------------------------------------------------------------- // Structure of data sent to the vertex shader //--------------------------------------------------------------------- struct VSInput { float3 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; //--------------------------------------------------------------------- // Structure of data sent to the pixel shader ( from the vertex shader ) //--------------------------------------------------------------------- struct PSInput { float4 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; //------------------------------------------------------------------------------------------ // VertexShaderFunction // 1. Read from VS structure // 2. Process // 3. Write to PS structure //------------------------------------------------------------------------------------------ PSInput VertexShaderFunction(VSInput VS) { PSInput PS = (PSInput)0; // Calculate screen pos of vertex PS.Position = MTACalcScreenPosition ( VS.Position ); // Pass through tex coord PS.TexCoord = VS.TexCoord; // Calculate GTA lighting for buildings float4 Diffuse = MTACalcGTABuildingDiffuse( VS.Diffuse ); PS.Diffuse = 0; if (bIsGTADiffuse) PS.Diffuse = Diffuse; else PS.Diffuse = float4(1,1,1,Diffuse.a); PS.Diffuse *= gColor; return PS; } //------------------------------------------------------------------------------------------ // PixelShaderFunction // 1. Read from PS structure // 2. Process // 3. Return pixel color //------------------------------------------------------------------------------------------ float4 PixelShaderFunction(PSInput PS) : COLOR0 { // Get texture pixel float4 texel = tex2D(Sampler0, PS.TexCoord); // Apply diffuse lighting float4 finalColor = texel * PS.Diffuse; return finalColor; } //------------------------------------------------------------------------------------------ // Techniques //------------------------------------------------------------------------------------------ technique colorize { pass P0 { VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } } // Fallback technique fallback { pass P0 { // Just draw normally } } Код наложение цвета, через шейдерную обработку на одно из колёс транспортного средства: local colorShader = dxCreateShader("shader.fx") local _, _, _, wheelsColorR, wheelsColorG, wheelsColorB = getVehicleColor(source, true) outputChatBox("#FFFFFFColor: R"..wheelsColorR.." G"..wheelsColorG.." B"..wheelsColorB, 0, 0, 0, true) local wheelsColor = {wheelsColorR, wheelsColorG, wheelsColorB, 255} dxSetShaderValue(colorShader, "gColor", wheelsColor) engineApplyShaderToWorldTexture(colorShader, "body_k", car_wheels[carID][1]) Need help!
  9. Hello. I have a script that create a missile that follows the player when he enters the specified collision shape using createProjectile. The projectile elements have a white blip by default and I need to change it to Red. Is there a way to do it?
  10. addEventHandler("onPlayerLogin", getRootElement(), function () local name = getPlayerName ( source ) name:gsub("#%x%x%x%x%x%x", "") if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." tulajdonos szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then exports[getResourceName(resource)]:addNotification(root, name.." szupermoderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Modi")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Operator")) then exports[getResourceName(resource)]:addNotification(root, name.." operátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("zuker")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Adminseged")) then exports[getResourceName(resource)]:addNotification(root, name.." adminsegéd szolgálatba lépett!", "warning") end end ) i added 'gsub' but the color code not disappear
  11. Hey, is there a function or something to remove the color code of me, and change RGB?
  12. Hey there, im here cause im having some issues with CEF Browser, the problem is that isn't showing the web-site color and i don't really know why. Original: MTA Browser:
×
×
  • Create New...