sawser Posted December 20, 2017 Share Posted December 20, 2017 السلام عليكم كيف اخلي الدم يكون دم السياره مب دم اللعب local screenW, screenH = guiGetScreenSize() function test() local hp = getElementHealth(localPlayer) setPlayerHudComponentVisible("health",false) dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412/100*hp, screenH * 0.0404, tocolor(254, 0, 0, 255), false) dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412, screenH * 0.0404, tocolor(254, 0, 0, 72), true) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) - 1, (screenW * 0.9926) - 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) - 1, (screenW * 0.9926) + 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) + 1, (screenW * 0.9926) - 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) + 1, (screenW * 0.9926) + 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", screenW * 0.8507, screenH * 0.5378, screenW * 0.9926, screenH * 0.5781, tocolor(255, 255, 255, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) end addEventHandler('onClientRender',root,test) function trueHud() setPlayerHudComponentVisible("health",true) end addEventHandler('onResourceStop',root,trueHud) Link to comment
mohamed hussein Posted December 20, 2017 Share Posted December 20, 2017 (edited) هتيجي قبل المتغير اللي اسمو Hp و تعمل كدة local veh = getPedOccupiedVehicle ( localPlayer) if veh then --علشان لو مش في السيارة ميطلعلكش خطاء local hp = getElementHealth ( veh ) end اسف الكود من الموبايل Edited December 20, 2017 by mohamed hussein Link to comment
Doffy Posted December 21, 2017 Share Posted December 21, 2017 (edited) On 12/20/2017 at 07:42, mohamed hussein said: هتيجي قبل المتغير اللي اسمو Hp و تعمل كدة local veh = getPedOccupiedVehicle ( localPlayer) if veh then --علشان لو مش في السيارة ميطلعلكش خطاء local hp = getElementHealth ( veh ) end اسف الكود من الموبايل X local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function ( ) if ( isPedInVehicle(localPlayer) ) then local Vehicle = getPedOccupiedVehicle( localPlayer ) local hp = getElementHealth(Vehicle); dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412 * hp / 100, screenH * 0.0404, tocolor(254, 0, 0, 255), false) dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412 , screenH * 0.0404, tocolor(254, 0, 0, 255), true) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) - 1, (screenW * 0.9926) - 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) - 1, (screenW * 0.9926) + 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) + 1, (screenW * 0.9926) - 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) + 1, (screenW * 0.9926) + 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", screenW * 0.8507, screenH * 0.5378, screenW * 0.9926, screenH * 0.5781, tocolor(255, 255, 255, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) end end ) try.. Edited December 21, 2017 by #Himoo Link to comment
iMr.WiFi..! Posted December 21, 2017 Share Posted December 21, 2017 3 hours ago, #Himoo said: X local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function ( ) if ( isPedInVehicle(localPlayer) ) then local Vehicle = getPedOccupiedVehicle( localPlayer ) local hp = getElementHealth(Vehicle); dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412 * hp / 100, screenH * 0.0404, tocolor(254, 0, 0, 255), false) dxDrawLine((screenW * 0.8515) - 1, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, (screenH * 0.5378) - 1, (screenW * 0.8515) - 1, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawLine((screenW * 0.8515) - 1, screenH * 0.5781, screenW * 0.9926, screenH * 0.5781, tocolor(0, 0, 0, 255), 1, true) dxDrawLine(screenW * 0.9926, screenH * 0.5781, screenW * 0.9926, (screenH * 0.5378) - 1, tocolor(0, 0, 0, 255), 1, true) dxDrawRectangle(screenW * 0.8515, screenH * 0.5378, screenW * 0.1412 , screenH * 0.0404, tocolor(254, 0, 0, 255), true) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) - 1, (screenW * 0.9926) - 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) - 1, (screenW * 0.9926) + 1, (screenH * 0.5781) - 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) - 1, (screenH * 0.5378) + 1, (screenW * 0.9926) - 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", (screenW * 0.8507) + 1, (screenH * 0.5378) + 1, (screenW * 0.9926) + 1, (screenH * 0.5781) + 1, tocolor(0, 0, 0, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) dxDrawText(""..math.floor(hp).."%", screenW * 0.8507, screenH * 0.5378, screenW * 0.9926, screenH * 0.5781, tocolor(255, 255, 255, 255), 1.30, "pricedown", "center", "center", false, false, false, false, false) end end ) try.. isn't X getPedOccupiedVehicle Returns the vehicle that the specified ped is in, or false if the ped is not in a vehicle or is an invalid ped.it's true ................. @_@ == علعموم كود الأخ الي فوق صحيح وما اشوف اي خطأ أتمنى تراجع الويكي قبل ماتقول انه خطأ .._.. 1 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