Jump to content

فنكشن


Recommended Posts

ممكن فنكشن يكتب كلام فوق الشخصية

+مثال على اي مود

  
function function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font) 
                local x, y, z = getElementPosition(TheElement) 
                local x2, y2, z2 = getElementPosition(localPlayer) 
                local distance = distance or 20 
                local height = height or 1 
                if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, true)) 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 
                            dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") 
            end 
        end 
    end 
end -- كل الاكواد الي فوق هي مالك دعوة بها هذا يوسفل فنكشن 
--نبدا من هنا 
randomPed = createPed(285,2476.91406,-1665.31799,13.32435) -- هنا نسوي بيد (شخصية) 
  
addEventHandler("onClientRender", getRootElement(), -- نسوي الحدث 
function () 
dxDrawTextOnElement(randomPed,"Text",1,20,0,0,255,255,1,"pricedown") -- هنا نسوي النص فوق البيد randomPed 
end) 
--dxDrawTextOnElement اسم اليوسفل فنكشن حق حسون 

:fadein:

الكود قديم ، روح شوف الويكي حدثته وضفت له اشياء ثانية

_____

طيب الكود جاهز اجربه؟؟

سيرفر ولا كلنت

الكود كلاينت ، لو تبي تفهم الارقمنتات وكل شي بالكود زور الصفحة حقته بالويكي

dxDrawTextOnElement

Link to comment
  • Replies 85
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

حسون انا ما اعرف للدي اكس ممكن تعطيني اي كود جاهز لانه بجرب عليه شي

الكود هو اصلا جاهز :|

روح لجهة كلنت ضيف الكود ذا

function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) 
                local x, y, z = getElementPosition(TheElement) 
                local x2, y2, z2 = getElementPosition(localPlayer) 
                local distance = distance or 20 
                local height = height 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 
                            dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") 
            end 
        end 
    end 
end 

ثم حط الكود ذا

اسم البيد حقك= createPed(285,2476.91406,-1665.31799,13.32435) 
  
addEventHandler("onClientRender", getRootElement(),  
function () 
dxDrawTextOnElement(اسم البيد حقك,"YOUR TEXT HERE",1,20,0,0,255,255,1,"pricedown") -- الواحد ذي لأرتفاع الخط عن رأس البيد ، ال20 مسافة الي يستيطع الاعب رؤوية الكلام منها ، ال 0 0 255 ذا كود الون ، ال1 كبر الخط والي بعدها هو نوع الخط 
end) 

Link to comment
طيب كيف يمديني اجيب اسم خط عجبني؟

+كلام العربي يطلع معكوس ما في حل؟؟

!!! ترا لو ضغطت على زر الرابط الي فوق مابيعضك الموقع

كل شي مكتوب هناك

"default": Tahoma

"default-bold": Tahoma Bold

"clear": Verdana

"arial": Arial

"sans": Microsoft Sans Serif

"pricedown": Pricedown (GTA's theme text)

"bankgothic": Bank Gothic Medium

"diploma": Diploma Regular

"beckett": Beckett Regular

Link to comment
ممكن فنكشن يكتب كلام فوق الشخصية

+مثال على اي مود

  
function function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font) 
                local x, y, z = getElementPosition(TheElement) 
                local x2, y2, z2 = getElementPosition(localPlayer) 
                local distance = distance or 20 
                local height = height or 1 
                if (isLineOfSightClear(x, y, z, x2, y2, z2, true, false, false, true)) 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 
                            dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") 
            end 
        end 
    end 
end -- كل الاكواد الي فوق هي مالك دعوة بها هذا يوسفل فنكشن 
--نبدا من هنا 
randomPed = createPed(285,2476.91406,-1665.31799,13.32435) -- هنا نسوي بيد (شخصية) 
  
addEventHandler("onClientRender", getRootElement(), -- نسوي الحدث 
function () 
dxDrawTextOnElement(randomPed,"Text",1,20,0,0,255,255,1,"pricedown") -- هنا نسوي النص فوق البيد randomPed 
end) 
--dxDrawTextOnElement اسم اليوسفل فنكشن حق حسون 

:fadein:

الكود قديم ، روح شوف الويكي حدثته وضفت له اشياء ثانية

_____

طيب الكود جاهز اجربه؟؟

سيرفر ولا كلنت

الكود كلاينت ، لو تبي تفهم الارقمنتات وكل شي بالكود زور الصفحة حقته بالويكي

dxDrawTextOnElement

اسف م كنت اعرف =)

Link to comment
طيب الحين عندي خط عربي كيف اضيفه مشان يشتغل ممكن شرح او شي اخوي غلبتك معي

ضيف سطر بالبداية

local font = dxCreateFont("font.ttf")  -- طبعا ذا اسم ملف الخط الي عندك ، لاتنسا تعرفه بالميتا 

ثم تروح للكود الي معطيه لك وتبدل

"arial"

font بـ

وبس خلصنا ،

Link to comment

مو ضابط يتغير

function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) 
                     
                    local x, y, z = getElementPosition(TheElement) 
                    local x2, y2, z2 = getElementPosition(localPlayer) 
                    local distance = distance or 20 
                    local height = height 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 
                                dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") 
                end 
            end 
        end 
    end 
     
     
    sz = createPed(285,199.75499,1916.53015,17.64063) 
  
addEventHandler("onClientRender", getRootElement(), 
function () 
local ff = dxCreateFont("ff.ttf") 
dxDrawTextOnElement(sz,"shop",1.2,20,234,116,32,255,3,"ff") -- الواحد ذي لأرتفاع الخط عن رأس البيد ، ال20 مسافة الي يستيطع الاعب رؤوية الكلام منها ، ال 0 0 255 ذا كود الون ، ال1 كبر الخط والي بعدها هو نوع الخط 
end) 
  
  

Link to comment
مو ضابط يتغير
function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement) 
                     
                    local x, y, z = getElementPosition(TheElement) 
                    local x2, y2, z2 = getElementPosition(localPlayer) 
                    local distance = distance or 20 
                    local height = height 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 
                                dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") 
                end 
            end 
        end 
    end 
     
     
    sz = createPed(285,199.75499,1916.53015,17.64063) 
  
addEventHandler("onClientRender", getRootElement(), 
function () 
local ff = dxCreateFont("ff.ttf") 
dxDrawTextOnElement(sz,"shop",1.2,20,234,116,32,255,3,"ff") -- الواحد ذي لأرتفاع الخط عن رأس البيد ، ال20 مسافة الي يستيطع الاعب رؤوية الكلام منها ، ال 0 0 255 ذا كود الون ، ال1 كبر الخط والي بعدها هو نوع الخط 
end) 
  
  

جرب

  
local ff = dxCreateFont("ff.ttf") 
addEventHandler("onClientRender", getRootElement(), 
function () 
dxDrawTextOnElement(sz,"shop",1.2,20,234,116,32,255,3,ff) -- الواحد ذي لأرتفاع الخط عن رأس البيد ، ال20 مسافة الي يستيطع الاعب رؤوية الكلام منها ، ال 0 0 255 ذا كود الون ، ال1 كبر الخط والي بعدها هو نوع الخط 
end) 
  

Link to comment

جرب ذا

local ff = dxCreateFont("music/ff.ttf") 
addEventHandler("onClientRender", getRootElement(), 
function () 
dxDrawTextOnElement(sz,"shop",1.2,20,234,116,32,255,3,ff) -- الواحد ذي لأرتفاع الخط عن رأس البيد ، ال20 مسافة الي يستيطع الاعب رؤوية الكلام منها ، ال 0 0 255 ذا كود الون ، ال1 كبر الخط والي بعدها هو نوع الخط 
end) 
  

انت كنت غلطان بـ وضع المسار الصحيح للخط

Link to comment
ERROR: Couldn't find file music/ff.ttf for resource aa 
Loading of resource 'aa' failed 
 

خلاص انسى اخوي ممكن اخر سؤال

playSound 

stopSound 

اخوي انا لما اركب اغنيه ويضغط زر تشتغل لكن اذا رجع ضغط عليها تتكرر ما في طريقه ما تتكرر اكثر من مره

وبالنسبه لأيقاف الموسيقى

مو راضي يقفل الموسيقى المود مسحته بس تعرف ليه اخوي؟؟

playSFX 

وش وظيفتة ذا وفي له مثال من عندك مع شرح خخفيف

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