Dzsozi (h03) Posted March 26, 2014 Share Posted March 26, 2014 Hello guys, so today I made a new hud. My problem is that I need to get the player's skin in picture, so how can I say... The image should be match with the ID and draw it in a picture on the hud. But mine is not working. Can somebody help me please? Here's a part of the code where this skin part is. local screenX, screenY = guiGetScreenSize() local skinID = tonumber(getPlayerSkin(localPlayer)) dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img/" .. skinID .. ".png") Link to comment
cheez3d Posted March 26, 2014 Share Posted March 26, 2014 getPlayerSkin() - This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be an alternative (usually more generic) way of performing what it once did. Also dxDrawImage() renders the image only for one frame so you must use it with onClientRender. local screenX, screenY = guiGetScreenSize() local skinID = getElementModel(localPlayer) addEventHandler("onClientRender",root,function() dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img/" .. skinID .. ".png") end) Link to comment
Dzsozi (h03) Posted March 26, 2014 Author Share Posted March 26, 2014 getPlayerSkin() - This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be an alternative (usually more generic) way of performing what it once did.Also dxDrawImage() renders the image only for one frame so you must use it with onClientRender. local screenX, screenY = guiGetScreenSize() local skinID = getElementModel(localPlayer) addEventHandler("onClientRender",root,function() dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img/" .. skinID .. ".png") end) Not working and my fps jumped to 7 from 60 How can I do this with guiCreateStaticImage? Link to comment
Anubhav Posted March 26, 2014 Share Posted March 26, 2014 local screenX, screenY = guiGetScreenSize() local skinID = getElementModel(localPlayer) addEventHandler("onClientRender",root,function() dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img\" .. skinID .. ".png") end) Lol.. A typo its \ not /... Maybe i am wrong not sure. Link to comment
Dzsozi (h03) Posted March 26, 2014 Author Share Posted March 26, 2014 local screenX, screenY = guiGetScreenSize() local skinID = getElementModel(localPlayer) addEventHandler("onClientRender",root,function() dxDrawImage(screenX*0.8505 , screenY*0.0915, 104, 104, "img\" .. skinID .. ".png") end) Lol.. A typo its \ not /... Maybe i am wrong not sure. No, it's /. Link to comment
Anubhav Posted March 26, 2014 Share Posted March 26, 2014 local screenX, screenY = guiGetScreenSize() local skinID = getElementModel(localPlayer) guiCreateStaticImage( screenX*0.8505 , screenY*0.0915, 104, 104, "img\" .. tostring(skinID) .. ".png" ) Try this. If there are errors please post.. Link to comment
WhoAmI Posted March 26, 2014 Share Posted March 26, 2014 local screenX, screenY = guiGetScreenSize ( ) local skinID = getElementModel ( localPlayer ) addEventHandler ( "onClientRender", root, function ( ) dxDrawImage ( screenX * 0.8505 , screenY * 0.0915, 104, 104, "img/" .. skinID .. ".png" ) end ) That works for sure, check if image is in meta. 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