X-SHADOW Posted February 28, 2013 Share Posted February 28, 2013 (edited) Fixed ! Edited February 28, 2013 by Guest Link to comment
HunT Posted February 28, 2013 Share Posted February 28, 2013 https://wiki.multitheftauto.com/wiki/OnClientRender ?? Link to comment
Castillo Posted February 28, 2013 Share Posted February 28, 2013 dxDrawImage requires "onClientRender" event in order to work. Link to comment
X-SHADOW Posted February 28, 2013 Author Share Posted February 28, 2013 Castillo I alredy Tried onClientRender + onClientPerRender + onClientResourceStart + onClientPlayerDamage ! i have set my health to 50 and 10 no images shown ? Link to comment
Moderators IIYAMA Posted February 28, 2013 Moderators Share Posted February 28, 2013 (edited) You also don't update the health. This isn't your code right? -- local localPlayer = getLocalPlayer() -- not needed local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 34, 0 addEventHandler ( "onClientRender", root, function () local health = getElementHealth( localPlayer ) if (health <= 50) then dxDrawImage(ax,ay,32,37,"images/lowhp.png") if (health <= 10) then local getTickStart = getTickCount () getTickStart = math.floor(getTickStart / 1000) if math.mod(getTickStart, 2) == 0 then dxDrawImage(ax,ay+37,32,37,"images/bleeding.png") end end -- ax = ax - 34 -- wtf? fly down? end end end) Edited February 28, 2013 by Guest Link to comment
iPrestege Posted February 28, 2013 Share Posted February 28, 2013 (edited) local screenWidth, screenHeight = guiGetScreenSize() local health = getElementHealth( localPlayer ) local ax, ay = screenWidth - 34, 0 function xxx() ax = ax -34 if (health <= 50) then dxDrawImage(ax,ay,32,37,"images/lowhp.png") if (health <= 10) then local getTickStart = getTickCount () getTickStart = math.floor(getTickStart / 1000) if math.mod(getTickStart, 2) == 0 then dxDrawImage(ax,ay+37,32,37,"images/bleeding.png") end end end end addEventHandler('onClientPlayerDamage', root,xxx) addEventHandler("onClientRender",root,xxx) Edited February 28, 2013 by Guest Link to comment
X-SHADOW Posted February 28, 2013 Author Share Posted February 28, 2013 No i found it on another scripting site the image is shown but show flying form right to left then dispeer ! i need it shown under the orgnial mta hud or next to radar ? ------------------ #Mr.Pres[T]ege your code dont show the image ! Link to comment
iPrestege Posted February 28, 2013 Share Posted February 28, 2013 works with me change the image position! Link to comment
Moderators IIYAMA Posted February 28, 2013 Moderators Share Posted February 28, 2013 the image is shown but show flying form right to left then dispeer ! I wrote this before, and I disable it after I noticed what would happen, not my mistake....... -- ax = ax - 34 -- wtf? fly down? try again my sample. Link to comment
iPrestege Posted February 28, 2013 Share Posted February 28, 2013 My One Should Work And The image Moving Up I Saw It . Link to comment
X-SHADOW Posted February 28, 2013 Author Share Posted February 28, 2013 Thank's Guys ! Its Dam Working ! I owe you all ! ~Topic Closde ~ ! Link to comment
iPrestege Posted February 28, 2013 Share Posted February 28, 2013 No Problem Can You Tell Us What Was The Problem? Link to comment
X-SHADOW Posted February 28, 2013 Author Share Posted February 28, 2013 Every Thing is Fixed ! Thank's To Very One Who Helped Me ! Link to comment
Anderl Posted March 1, 2013 Share Posted March 1, 2013 My One Should Work And The image Moving Up I Saw It . Your code contains unnecessary events. 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