Jump to content

سؤال عن Useful Functions


Mhmd.z

Recommended Posts

Useful Functions = هي فنكشات مفيدة تسآعدك على الآختصآر

setElementSpeed كـ مثآل الوظيفة الي حطيتها

الوظيفة هذي تحط سرعة محدد للألمنت الي تحدده أنت

مع ضرب وقسمة وحوسة setElementVelocityمع getElementVelocity طبعاً هـ الوظيفة تسآعدك اذا كنت تبي تستخدمها بدل لا تستخدم الوظائف

هـ الوظيفة رآح تسآعدكك وكذآلكك هنآلك الكثير من الوظائف التي من الممكن أن تسآعدكك

https://wiki.multitheftauto.com/wiki/Useful_Functions

Link to comment
Useful Functions = هي فنكشات مفيدة تسآعدك على الآختصآر

setElementSpeed كـ مثآل الوظيفة الي حطيتها

الوظيفة هذي تحط سرعة محدد للألمنت الي تحدده أنت

مع ضرب وقسمة وحوسة setElementVelocityمع getElementVelocity طبعاً هـ الوظيفة تسآعدك اذا كنت تبي تستخدمها بدل لا تستخدم الوظائف

هـ الوظيفة رآح تسآعدكك وكذآلكك هنآلك الكثير من الوظائف التي من الممكن أن تسآعدكك

https://wiki.multitheftauto.com/wiki/Useful_Functions

^ +

لازم تخلي الكود المهم مثلا لفنكشن

setElementSpeed

وهذا الكود المهم حقه ادا ماخليته مايشتغل الكود بالكامل

function setElementSpeed(element, unit, speed) 
    if (unit == nil) then unit = 0 end 
    if (speed == nil) then speed = 0 end 
    speed = tonumber(speed) 
    local acSpeed = getElementSpeed(element, unit) 
    if (acSpeed~=false) then -- if true - element is valid, no need to check again 
        local diff = speed/acSpeed 
        if diff ~= diff then return end -- if the number is a 'NaN' return end. 
        local x,y,z = getElementVelocity(element) 
        setElementVelocity(element,x*diff,y*diff,z*diff) 
        return true 
    end 
  
    return false 
end 

او مثلا

isMouseInPosition

هذا حق تأثير للدي اكس او وضائف اخرة عديدة

و هذا الكود المهم حقه

function isMouseInPosition ( x, y, width, height ) 
    if ( not isCursorShowing ( ) ) then 
        return false 
    end 
  
    local sx, sy = guiGetScreenSize ( ) 
    local cx, cy = getCursorPosition ( ) 
    local cx, cy = ( cx * sx ), ( cy * sy ) 
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then 
        return true 
    else 
        return false 
    end 
end 

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...