[YARDIM] Script Çözünürlüğü

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı 4VCI

  • 4VCI#4969(discord)
  • Acemi Üye
  • *
    • İleti: 177
  • Pertinacious Vargant Stars
    • Pertinacious Vargant Stars
: 17 Ocak 2019, 18:44:02
Merhaba dostlarım, Kullandığım 2 tane script var. çözünürlükten çözünürlüğe yerleri değişiyor sanırsam bunun olmaması için bir kod ekliyorduk yardımcı olabilecek varmı  ?
« Son Düzenleme: 02 Şubat 2019, 12:12:18 Gönderen: Narkoz »
[DD/DM] Player
 


MTASATURK

[YARDIM] Script Çözünürlüğü
« : 17 Ocak 2019, 18:44:02 »

Çevrimdışı Qwerty

  • Yeni Üye
  • *
    • İleti: 25
Yanıtla #1 : 17 Ocak 2019, 19:15:22
Wikiden bakarsan bula bilirsin tam hatırlamıyorum ama setScreenVisible'miydi hatırlamıyorum.
 


Çevrimdışı 4VCI

  • 4VCI#4969(discord)
  • Acemi Üye
  • *
    • İleti: 177
  • Pertinacious Vargant Stars
    • Pertinacious Vargant Stars
Yanıtla #2 : 17 Ocak 2019, 19:24:23
Linki görebilmek için Kayıt olun yada Giriş yapın.
Wikiden bakarsan bula bilirsin tam hatırlamıyorum ama setScreenVisible'miydi hatırlamıyorum.
Konu adı vs. hiç birşey bilmiyorum belki bilen çıkar buradan..
[DD/DM] Player
 


Çevrimdışı MarkeloF

  • Admin
  • *
    • İleti: 901
  • Maybe later.
Yanıtla #3 : 17 Ocak 2019, 21:46:56
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı 4VCI

  • 4VCI#4969(discord)
  • Acemi Üye
  • *
    • İleti: 177
  • Pertinacious Vargant Stars
    • Pertinacious Vargant Stars
Yanıtla #4 : 17 Ocak 2019, 23:43:32
Garip ama beceremedim. Zahmet olmayacaksa eğer

1.)
Spoiler for Hiden:
--[[
 
                ** Distance To Hunter v1.0 - Made by Pr0RaC3R **
                ** Special credits to Citizen & H5N1 from MTA Forum for helping me with some issues! **
--]]
 
local screenW, screenH = guiGetScreenSize()
addEventHandler ( "onClientRender", getRootElement(), DXtext )
addEvent('onClientMapStarting')
 
hunterX, hunterY, hunterZ = 0,0,0
local sWidth,sHeight = guiGetScreenSize ( )
 
function loadHunterPosition ()
    for _,e in pairs ( getElementsByType ( "racepickup") or {} ) do -- Loop through race pickup elements (nitro, repair, vehiclechange)
        local t = getElementData (e, "type")
        if t and t == "vehiclechange" then
            local v = getElementData (e,"vehicle")
            if v and tonumber(v) == 425 then -- If it finds hunter pickup...
                hunterX, hunterY, hunterZ = getElementPosition ( e ) -- Get hunter position
                break
            end
        end
    end
end
 
function drawDistance ( )
    loadHunterPosition ( )
    --local screenW, screenH = guiGetScreenSize()
    local playerX, playerY, playerZ = getElementPosition ( getLocalPlayer( ) ) -- Get player position
    local distFromVehicleToHunter = getDistanceBetweenPoints3D ( playerX, playerY, playerZ, hunterX, hunterY, hunterZ ) -- Calculate distance
    local screenW, screenH = guiGetScreenSize()
    dxDrawText ("Huntere kalan mesafe:",sWidth-485,sHeight-758,sWidth-415,sHeight-17,tocolor(255,0,0,255),1.0,"verdana","left","top",false,false,false) -- Create DX Text
    dxDrawImage(
    (sWidth-699),
    (sHeight-31),
    (265),
    (30),
    "images/DistToHunter-Logo.png",0.0,0.0,0.0,tocolor(255,255,255,255),false)
    dxDrawText( string.format("%.0f",distFromVehicleToHunter) .. " m ",sWidth-360,sHeight-755.8,sWidth-166,sHeight-17,tocolor(255,255,255,255),0.4,"bankgothic","left","top",false,false,false)
end
 
function handleRender ( )
    addEventHandler ( 'onClientRender', root, drawDistance )
end
 
addEventHandler ( 'onClientMapStarting', root, handleRender )
 
function delRender ( )
    removeEventHandler ( 'onClientRender', root, drawDistance )
end
 
addEventHandler ( 'onClientPlayerWasted', getLocalPlayer(), delRender )
 
function delRenderForDeath ( )
    if ( getElementHealth ( getLocalPlayer() ) == '0' ) then
        removeEventHandler ( 'onClientRender', root, drawDistance )
    end
end
 

2.)
Spoiler for Hiden:
Spoiler for Hiden:
local Width, Height = guiGetScreenSize()

local Positions = {Width-10-330, 8}

local Health, Armour, Oxygen, CarHP = 0, 0, 0, 0
local R, G, B = 0, 177, 37

--[[local Weapons = {"fist", "knuckle", "golf", "nights", "knife", "bat", "shovel", "cue", "katana", "chainsaw",
   "pistol", "silenced",
   "shotgun", "combat",
   "machg", "tec",
   "ak", "m4",
   "rocketla", ""}]]

local AmmoPos = {8, 19}
local CarpPos = {18, 19}
local WantedPos = {8, 19}

local font = dxCreateFont("opensanslight.ttf", 12)

local customHUDEnabled = false

local switchingRadio = false

function enableCustomHUD()
   customHUDEnabled = not customHUDEnabled
   setPlayerHudComponentVisible("ammo", not customHUDEnabled)
   setPlayerHudComponentVisible("health", not customHUDEnabled)
   setPlayerHudComponentVisible("armour", not customHUDEnabled)
   setPlayerHudComponentVisible("breath", not customHUDEnabled)
   setPlayerHudComponentVisible("clock", not customHUDEnabled)   
   setPlayerHudComponentVisible("money", not customHUDEnabled)
   setPlayerHudComponentVisible("weapon", not customHUDEnabled)
   setPlayerHudComponentVisible("vehicle_name", not customHUDEnabled)
   setPlayerHudComponentVisible("area_name", not customHUDEnabled)
   setPlayerHudComponentVisible("radio", not customHUDEnabled)
   setPlayerHudComponentVisible("wanted", not customHUDEnabled)
   --setPlayerHudComponentVisible("radar", not customHUDEnabled)
end

addCommandHandler("customhud", enableCustomHUD)
enableCustomHUD()

addEventHandler("onClientRender", root, function()

   if not customHUDEnabled then return false end
   Health, Armour, Oxygen = localPlayer.health, localPlayer.armor, localPlayer.oxygenLevel
   if Health > 100 then Health = 100 end
   if Armour > 100 then Armour = 100 end
   if Oxygen > 1000 then Oxygen = 1000 end

   --dxDrawImage(Positions[1], Positions[2], 330, 54, "Elements/round.png") --Central Round for infobar

   --dxDrawImage(Positions[1]+10, Positions[2]+9, 36, 36, "Elements/weaps/rocketla.png")

   --Health Bar   
   --dxDrawImage(Positions[1], Positions[2], 330, 54, "Elements/healthbar.png")
   --Armour/Oxygen Bar
   if (Armour > 0) or (isElInWater(localPlayer) and Armour <= 0) then dxDrawImage(Positions[1], Positions[2], 330, 54, "Elements/armorbar.png") end
   --Oxygen Bat
   if isElInWater(localPlayer) and Armour > 0 then
      dxDrawImage(Positions[1], Positions[2], 330, 54, "Elements/oxybar.png")
   end

   --Health level
   --dxDrawImageSection(
         --Positions[1]+4+(279-(Health*2.79)), Positions[2]+21,       Health*2.79, 3,  --Тут творится полнейший песдес, добился сия методом подбора координат, и хз, что тут происходит.
         --279-(Health*2.79), 0,       Health*2.79, 3,
         --"Elements/health.png",
         --0, 0, 0,
         --tocolor(255, 0, 0))

   --Oxygen level
   --if isElInWater(localPlayer) and Armour > 0 then
      --dxDrawImageSection(
         --Positions[1]+174+(115-(Oxygen*0.115)), Positions[2]+39,       Oxygen*0.115, 3,
         --115-(Oxygen*0.115), 0,       Oxygen*0.115, 3,
         --"Elements/oxygen.png",
         --0, 0, 0,
         --tocolor(0, 132, 255))
   --end
   --Armour/Oxygen level
   --if (Armour > 0) or (isElInWater(localPlayer) and Armour <= 0) then
      --if Armour <= 0 then Armour, R, G, B = Oxygen/10, 0, 132, 255
      --else R, G, B = 0, 177, 37 end
      --dxDrawImageSection(
         --Positions[1]+43+(240-(Armour*2.4)), Positions[2]+30,       Armour*2.4, 3,
         --240-(Armour*2.4), 0,       Armour*2.4, 3,
         --"Elements/armour.png",
         --0, 0, 0,
         --tocolor(R, G, B))
   --end

   --Time
   local h, m = getTime()
   --dxDrawImage(Width-130, Positions[2]+56, 120, 40, "Elements/panel.png")
   --dxDrawText(string.format("%i:%.2i", h, m), Width-130, Positions[2]+56, Width-10, Positions[2]+56+40, _, 1, font, "center", "center", true)
   --dxDrawText(string.format("%i:%.2i", h, m), Width-130, Positions[2]+56, Width-10, Positions[2]+56+40, _, 1, font, "center", "center", true)

   --Money
   --dxDrawText(string.format("$%.8i", getPlayerMoney(localPlayer)), Positions[1], 0, Positions[1]+276, 28,
      --_, 1, font, "right", "center", true)

   --Ammo
   if isPlayerAmmoWeapon(localPlayer) then
      AmmoPos[2] = getPedAmmoInClip(localPlayer)*(19/getWeaponProperty(getPedWeapon(localPlayer), getPedWeaponSkill(localPlayer, getPedWeapon(localPlayer)), "maximum_clip_ammo"))
      AmmoPos[1] = 8+(19-AmmoPos[2])
      --dxDrawImage(Positions[1]+AmmoPos[1]+276, Positions[2]+AmmoPos[1], 2*AmmoPos[2], 2*AmmoPos[2], "Elements/ammoround.png")
      --dxDrawImage(Width-250, Positions[2]+56, 120, 40, "Elements/panel.png")
      --dxDrawText(getPedAmmoInClip(localPlayer).."/"..getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer),
         --Width-250, Positions[2]+56, Width-130, Positions[2]+56+40, _, 1, font, "center", "center", true)
   end



   if localPlayer.inVehicle then
        local screenWidth, screenHeight = guiGetScreenSize()
      --Car Health
      CarHP = localPlayer.vehicle.health or 1000
      if CarHP > 1000 then CarHP = 1000 end
      dxDrawImage(711, Height-92, 330, 54, "Elements/vehicle/vehicle.png")
      dxDrawImage(711, Height-92, 330, 54, "Elements/vehicle/carhpbar.png")
      --dxDrawText(getVehicleName(localPlayer.vehicle), 10, Height-300, 330, Height-27, _, 1, font, "left", "center", true)
      dxDrawImageSection(
         758, Height-62, CarHP*0.24, 3,
         0, 0, CarHP*0.24, 3,
         "Elements/vehicle/carhp.png",
         0, 0, 0,
         tocolor(255, 0, 0))

      --Nitro
                local screenWidth, screenHeight = guiGetScreenSize()
      local nitro = getVehicleNitroLevel(localPlayer.vehicle)
      if nitro and nitro > 0 then
         dxDrawImage(711, Height-92, 330, 54, "Elements/vehicle/nitrobar.png")
         dxDrawImageSection(
            753, Height-54, nitro*115, 3,
            0, 0, nitro*115, 3,
            "Elements/vehicle/nitro.png",
            0, 0, 0,
            tocolor(0, 85, 255))
      end


      --Speedometr
      local speed = around(getElementSpeed(localPlayer.vehicle), 200)

      --dxDrawImage(Width-200, Height-53, 120, 40, "Elements/panel.png")
      --dxDrawText(speed.." KM/H", Width-200, Height-53, Width-80, Height-13, _, 1, font, "center", "center", true)

      --dxDrawImage(Width-230, Height-260, 200, 200, "Elements/vehicle/speed.png")
      --dxDrawImage(Width-230, Height-260, 200, 200, "Elements/vehicle/speedline.png", speed*1.3)

      if speed > 120 then speed = 120 end
                local screenWidth, screenHeight = guiGetScreenSize()
      CarpPos[2] = speed*(17/120)
      CarpPos[1] = 17+(19-CarpPos[2])
      dxDrawImage(Width-322+CarpPos[1], (Height-101)+CarpPos[1], 2*CarpPos[2], 2*CarpPos[2], "Elements/ammoround.png")
      --Radio
      if switchingRadio then
         --dxDrawImage(310, Height-53, 160, 40, "Elements/vehicle/rpanel.png")
         --dxDrawText(getRadioChannelName(getRadioChannel()), 310, Height-53, 470, Height-13, _, 1, font, "center", "center", true)
      end

   end
   
   --Location
   local x, y, z = getElementPosition(localPlayer or localPlayer.vehicle)
   --dxDrawText(getZoneName(x, y, z, true), Width-310, Positions[2]+56+50, Width-10, Positions[2]+56+50+20, _, 1, font, "right", "center", true)
   if getZoneName(x, y, z, true) ~= getZoneName(x, y, z) then
      dxDrawText(getZoneName(x, y, z), Width-310, Positions[2]+56+50+20, Width-10, Positions[2]+56+50+40, _, 1, font, "right", "center", true)
   end


   --Wanted Level
   if localPlayer:getWantedLevel() > 0 then
      WantedPos[2] = localPlayer:getWantedLevel() * (19/6)
      WantedPos[1] = 8+(19-WantedPos[2])
      dxDrawImage(Positions[1]+WantedPos[1]+276, Height-62+WantedPos[1], 2*WantedPos[2], 2*WantedPos[2], "Elements/ammoround.png")
      dxDrawImage(Positions[1], Height-62, 330, 54, "Elements/round.png")
      dxDrawText(localPlayer:getWantedLevel(), Positions[1], Height-62, Positions[1]+280, Height-62+38+15, _, 1, font, "right", "center", true)

   end




   --radar
   --Долго буду ебаться с этой хуйнёй, хотя уже заебался
   --[[local AR, AG, AB = getPlayerNametagColor(localPlayer)
   --dxDrawImage(Width-250, Height-250, 190, 190, "Elements/radar/radar.png")
   --dxDrawImage(Width-250, Height-250, 190, 190, "Elements/radar/blip.png", 0, 0, 0, tocolor(AR, AG, AB))
   for _, v in ipairs(getElementsByType("vehicle")) do
      if v == localPlayer then return false end
      local r = getDistanceBetweenPoints2D(localPlayer.position.x, localPlayer.position.y, v.position.x, v.position.y)
      if r > radius then

      end
   end]]

end)

local timer = nil
addEventHandler("onClientPlayerRadioSwitch", localPlayer, function()
   if isTimer(timer) then killTimer(timer) end
   switchingRadio = true
   timer = setTimer(function()   switchingRadio = false end, 1000, 1)
end)

function isElInWater(player) return (player.inVehicle == true and player.vehicle or player).inWater end

function getPedWeaponSkill(player, id)
   if id == 22 then id = 69
   elseif id == 23 then id = 70
   elseif id == 24 then id = 71
   elseif id == 25 then id = 72
   elseif id == 26 then id = 73
   elseif id == 27 then id = 74
   elseif id == 28 then id = 75
   elseif id == 29 then id = 76
   elseif id == 32 then id = 75
   elseif id == 30 then id = 77
   elseif id == 31 then id = 78
   elseif id == 34 then id = 79
   else return "poor" end
   
   local s = getPedStat(player, id)
   if s == 0 then return "poor"
   elseif s == 999 then return "pro"
   else return "std" end
end

--local ammweaps = {16, 17, 18, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43}
function isPlayerAmmoWeapon(player)
   local w = getPedWeapon(player)

   if w == 16 or w == 17 or w == 18 or w == 22 or w == 23 or
      w == 24 or w == 25 or w == 26 or w == 27 or w == 28 or w == 29 or
      w == 30 or w == 31 or w == 32 or w == 33 or w == 34 or w == 35 or
      w == 36 or w == 37 or w == 39 or w == 41 or w == 42 or w == 43
         then return true
   else return false end
   
end

function getElementSpeed(element, k)
   local speedx, speedy, speedz = getElementVelocity(element)
   local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
   if k == "kmh" or k == nil or k == 1 then return around(actualspeed * 180, 5)
   elseif k == "mps" or k == 2 then return around(actualspeed * 50, 5)
   elseif k == "mph" or k == 3 then return around(actualspeed * 111.847, 5) end
end

function around(fst, snd)
     local mid = math.pow(10,snd)
     return math.floor((fst*mid)+0.5)/mid
end

[/b]
[DD/DM] Player
 


Çevrimdışı Mahlukat

  • Uzman Üye
  • *
    • İleti: 637
Yanıtla #5 : 18 Ocak 2019, 08:12:18
0 yazan yer ile oynamana gerek olmasa da olur
10 yan yeri ne kadar çoğaltırsan yazı aşşağı iner
Kod
dxDrawText ("Huntere kalan mesafe:",0,10,screenW,screenH,tocolor(255,0,0,255),1.0,"verdana","center","top",false,false,false) 
Diğer satırları da bu koda bakarak değiştirebilirsin
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


MTASATURK

Ynt: [YARDIM] Script çözünürlüğü
« Yanıtla #5 : 18 Ocak 2019, 08:12:18 »