[YARDIM] Admin Logo Oluşturma

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı cenk11

  • Yeni Üye
  • *
    • İleti: 47
: 21 Eylül 2018, 12:28:04
Selamlar
Daha önce br arkadaşta burda sormus ama çözülmeden konu kapanmış gibi. Ben kodlarla biraz oynadım ve 'owner' acl grubunda olan sadece bu logoyu kullanacak. Hersey mantıklıyken yine çalısmıyor. Acaba calısmama nedenini bilen söyleyebilirmi, şimdiden teşekkürler herkese.

Server:
Kod: lua
addEventHandler("onResourceStart", resourceRoot, function()
        for i, player in ipairs(getElementsByType("player")) do
            if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Owner")) then
                    setElementData(player,"Owner",true)
        end                     
        end
end)
 
addEventHandler("onPlayerLogin", root, function(_, acc)
    if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("Owner")) then
        setElementData(source,"Owner",true)
    end
end)

Client:
Kod: lua
local imgW = 500
local imgH = 90
function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
  local x, y, z = getElementPosition(TheElement)
  local x2, y2, z2 = getElementPosition(localPlayer)
  local distance = distance or 20
  local height = height or 1
  local width = width or 1
  local checkBuildings = checkBuildings or true
  local checkVehicles = checkVehicles or false
  local checkPeds = checkPeds or false
  local checkObjects = checkObjects or true
  local checkDummies = checkDummies or true
  local seeThroughStuff = seeThroughStuff or false
  local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
  local ignoredElement = ignoredElement or nil
  if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
    local sx, sy = getScreenFromWorldPosition(x, y, z+height)
    if(sx) and (sy) then
      local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
      if(distanceBetweenPoints < distance) then
        dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
      end
    end
  end
end
function adminLogo()
    for i, player in ipairs(getElementsByType ('player')) do
        if getElementData(player,"Owner") then
            if player ~= localPlayer then
dxDrawImageOnElement(player, "logo.png", 20, imgH, imgW )
            end
        end
    end
end
addEventHandler("onClientPreRender", root, adminLogo)
« Son Düzenleme: 21 Eylül 2018, 13:23:41 Gönderen: Paradox »
 


MTASATURK

[YARDIM] Admin Logo Oluşturma
« : 21 Eylül 2018, 12:28:04 »

Çevrimdışı Paradox

  • Kurucu
  • *
    • İleti: 684
  • SH Gaming
Yanıtla #1 : 21 Eylül 2018, 13:20:38
Client
Kod: lua
local imgW = 0.5
local imgH = 0.6
local tag = dxCreateTexture("logo.png")

function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local width = width or 1
                                local checkBuildings = checkBuildings or true
                                local checkVehicles = checkVehicles or false
                                local checkPeds = checkPeds or false
                                local checkObjects = checkObjects or true
                                local checkDummies = checkDummies or true
                                local seeThroughStuff = seeThroughStuff or false
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
                                local ignoredElement = ignoredElement or nil
if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
local sx, sy = getScreenFromWorldPosition(x, y, z+height)
if(sx) and (sy) then
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distanceBetweenPoints < distance) then
dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
end
end
end
end

function adminLogo()
    for i, player in ipairs(getElementsByType ('player')) do
        if getElementData(player,"Owner") then
if player ~= localPlayer then
dxDrawImageOnElement(player, tag,20,imgH,imgW )
end
        end
    end
end
addEventHandler("onClientPreRender", root, adminLogo)

Bu şekilde çalışır.
 


Çevrimdışı cenk11

  • Yeni Üye
  • *
    • İleti: 47
Yanıtla #2 : 21 Eylül 2018, 13:50:06
teşekkürler çalıştı :) ama ben goremıyorum bendekini karsımdaki goruyor.benim görmem için ne yapmalıyım fikrin varmı ?
 


Çevrimdışı Paradox

  • Kurucu
  • *
    • İleti: 684
  • SH Gaming
Yanıtla #3 : 21 Eylül 2018, 13:55:33
Linki görebilmek için Kayıt olun yada Giriş yapın.
teşekkürler çalıştı :) ama ben goremıyorum bendekini karsımdaki goruyor.benim görmem için ne yapmalıyım fikrin varmı ?

Bu fonksiyonu bu şekilde yaparsan kendinde de gözükür.
Kod: lua
function adminLogo()
    for i, player in ipairs(getElementsByType ('player')) do
        if getElementData(player,"Owner") then
dxDrawImageOnElement(player, tag,20,imgH,imgW )
        end
    end
end
addEventHandler("onClientPreRender", root, adminLogo)