#FeldMan Posted December 1, 2018 Share Posted December 1, 2018 طبعأ أنأ لي زمان أدور ذأ الكود وأتمنى تسأعدوني isElementMoving ذا موجود بيه الكود ذأ dxDrawText أنأ ابي الكود ل dxDrawRectangle أتمنا تسأعدني لو تعرف Link to comment
#Major . Posted December 1, 2018 Share Posted December 1, 2018 ايش المشكلة يعني لهدرجة صعب الموضوع؟ function isElementMoving (theElement ) if isElement ( theElement ) then -- First check if the given argument is an element return Vector3( getElementVelocity( theElement ) ).length ~= 0 end return false end -- Keep the text visible with onClientRender. addEventHandler ( "onClientRender", root, idleCheck ) addEvnetHandler( "onClientRender", root, function() if ( isElementMoving(localPlayer) ) then dxDrawText("Hello"......etc) end end) Link to comment
#FeldMan Posted December 1, 2018 Author Share Posted December 1, 2018 *RayaN-Alharbi. أبيه لل dxDrawRectangle \ مش لل تيكست Link to comment
#Major . Posted December 1, 2018 Share Posted December 1, 2018 16 minutes ago, #MaHdI said: *RayaN-Alharbi. أبيه لل dxDrawRectangle \ مش لل تيكست نفس الطريقة فرقت يعني.؟ Link to comment
#FeldMan Posted December 1, 2018 Author Share Posted December 1, 2018 7 minutes ago, *RayaN-Alharbi. said: نفس الطريقة فرقت يعني.؟ function isElementMoving (theElement ) if isElement ( theElement ) then -- First check if the given argument is an element return Vector3( getElementVelocity( theElement ) ).length ~= 0 end return false end local screenWidth, screenHeight = guiGetScreenSize () local x,y = guiGetScreenSize() local show = true setElementData(localPlayer, "thirsty", 30) function drawHud() if (show==true) then local thirsty = getElementData(localPlayer, "thirsty") local playermoney = getPlayerMoney() dxDrawRectangle(473, 109, 92, 27, tocolor(0, 0, 0, 150)) dxDrawRectangle(x-326, 34+80, thirsty*3, 17, tocolor(1, 96, 253, 255)) dxDrawText("Fatigue" .. (isElementMoving(getPedOccupiedVehicle(localPlayer) or localPlayer) and ".") or ("idling").. "!", 499, 114, 563, 131, tocolor(255, 255, 255), 1, "default-bold", "center") end end addEventHandler("onClientRender", root, drawHud) setTimer(function() local under1 = getElementData(localPlayer, "thirsty") setElementData(localPlayer, "thirsty", under1-1) end, 2000, 0) addEventHandler("onClientRender", root, setTimer) function die() local piageci = getElementData(localPlayer, "thirsty") if (piageci==0) then setElementData(localPlayer, "thirsty", 30) setElementHealth(localPlayer, 0) end end addEventHandler("onClientElementDataChange", root, die) -- Hide the hud when the resource is started local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" } addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end) function fixhud() setPlayerHudComponentVisible( component, false ) end addCommandHandler("fixhud", fixhud) تقدر تركبه على ذأ الكود لأني مبتدأ في البرمجة *RayaN-Alharbi. Link to comment
Guest Posted December 8, 2018 Share Posted December 8, 2018 (edited) On 01/12/2018 at 10:28, *RayaN-Alharbi. said: نفس الطريقة فرقت يعني.؟ فشلتنا الرجال يأخي الله يهديك ذذ .. function isElementMoving (theElement ) if isElement ( theElement ) then -- First check if the given argument is an element return Vector3( getElementVelocity( theElement ) ).length ~= 0 end return false end local screenWidth, screenHeight = guiGetScreenSize () local x,y = guiGetScreenSize() local show = true setElementData(localPlayer, "thirsty", 30) function drawHud() if (show==true) then local thirsty = getElementData(localPlayer, "thirsty") local playermoney = getPlayerMoney() dxDrawRectangle(473, 109, 92, 27, tocolor(0, 0, 0, 150)) dxDrawRectangle(x-326, 34+80, thirsty*3, 17, tocolor(1, 96, 253, 255)) dxDrawText("Fatigue" .. (isElementMoving(getPedOccupiedVehicle(localPlayer) or localPlayer) and ".") or ("idling").. "!", 499, 114, 563, 131, tocolor(255, 255, 255), 1, "default-bold", "center") end end addEventHandler("onClientRender", root, drawHud) setTimer(function() local under1 = getElementData(localPlayer, "thirsty") setElementData(localPlayer, "thirsty", under1-1) end, 2000, 0) addEventHandler("onClientRender", root, setTimer) function die() local piageci = getElementData(localPlayer, "thirsty") if (piageci==0) then setElementData(localPlayer, "thirsty", 30) setElementHealth(localPlayer, 0) end end addEventHandler("onClientElementDataChange", root, die) -- Hide the hud when the resource is started local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" } addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end) function fixhud() setPlayerHudComponentVisible( component, false ) end addCommandHandler("fixhud", fixhud) . جرب Edited December 8, 2018 by Guest Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now