Jump to content

صورة فوق الشخصيه


Recommended Posts

* dxDrawImageOnElement

*only Client Side

Author: HasoN

Syntax:

boolean dxDrawImageOnElement(element TheElement, element Image [, int distance, int height, int width, int R, int G, int B, int alpha ] ) 

Required Arguments:

• TheElement : الألمنت الي تبي ترسم عليه الصورة

• Image : عشان تسويها dxCreateTexture ألصورة الي تبي تحطها ، استعمل

Optional Arguments:

• distance : ألمسافة الي تقدر منها تشوف الصورة ، المسافة الافتراضية هي 20

• height : أرتفاع الصورة ، الارتفاع الافتراضي هو 1

• width : عرض الصورة ، العرض الافتراضي هو 1

• R : الون الافتراضي 255 , R لون الـ

• G : الون الافتراضي 255 , G لون الـ

• B : الون الافتراضي 255 , B لون الـ

• alpha : شفافية الصورة ، الشفافية الأفتراضية 255

Code:

  
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 
                if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, false)) 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 
  

Example: #1

_______

Grove street ألمثال ذا يرسم صورة على بيد انا مسويه بال

  
randomPed = createPed(285,2506.83423,-1684.89941,13.55648) 
tag = dxCreateTexture("crown.png") 
  
addEventHandler("onClientPreRender", root, 
function() 
dxDrawImageOnElement(randomPed,tag) 
end) 
  

Example: #2

_______

ألمثال ذا يرسم صورة على كل السيارات بالعبة

  
local tag = dxCreateTexture("bike.png") 
  
addEventHandler("onClientPreRender", root, 
function() 
for k,v in ipairs(getElementsByType("vehicle")) do 
dxDrawImageOnElement(v,tag) 
end 
end) 
  

اتمنى الكود نال على اعجابكم وشكرا

wikiPage: https://wiki.multitheftauto.com/wiki/Dx ... eOnElement

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...