X-SHADOW Posted February 28, 2013 Posted February 28, 2013 (edited) Fixed ! Edited February 28, 2013 by Guest My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
HunT Posted February 28, 2013 Posted February 28, 2013 https://wiki.multitheftauto.com/wiki/OnClientRender ?? @Huntone_
Castillo Posted February 28, 2013 Posted February 28, 2013 dxDrawImage requires "onClientRender" event in order to work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
X-SHADOW Posted February 28, 2013 Author Posted February 28, 2013 Castillo I alredy Tried onClientRender + onClientPerRender + onClientResourceStart + onClientPlayerDamage ! i have set my health to 50 and 10 no images shown ? My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
Moderators IIYAMA Posted February 28, 2013 Moderators 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 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
iPrestege Posted February 28, 2013 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
X-SHADOW Posted February 28, 2013 Author 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 ! My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
Moderators IIYAMA Posted February 28, 2013 Moderators 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
iPrestege Posted February 28, 2013 Posted February 28, 2013 My One Should Work And The image Moving Up I Saw It .
X-SHADOW Posted February 28, 2013 Author Posted February 28, 2013 Thank's Guys ! Its Dam Working ! I owe you all ! ~Topic Closde ~ ! My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
iPrestege Posted February 28, 2013 Posted February 28, 2013 No Problem Can You Tell Us What Was The Problem?
X-SHADOW Posted February 28, 2013 Author Posted February 28, 2013 Every Thing is Fixed ! Thank's To Very One Who Helped Me ! My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
Anderl Posted March 1, 2013 Posted March 1, 2013 My One Should Work And The image Moving Up I Saw It . Your code contains unnecessary events. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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