-RoCk-Alex Posted March 12, 2012 Share Posted March 12, 2012 is there any way of replacing not creating new DX just replacing...? Link to comment
Kenix Posted March 12, 2012 Share Posted March 12, 2012 showPlayerHudComponent dxDrawText Link to comment
bandi94 Posted March 12, 2012 Share Posted March 12, 2012 you mean to change the color ? Link to comment
X-SHADOW Posted March 12, 2012 Share Posted March 12, 2012 (edited) function DXdraw() --Variables sWidth, sHeight = guiGetScreenSize() moneycount=getPlayerMoney(getLocalPlayer()) money= 'Cash>' ..moneycount dxDrawText(tostring">tostring (money),sWidth-450,sHeight-500,sWidth-7,sHeight-57,tocolor(255,0,0,220),1.0,"pricedown","right","top",false,false,false) -- Money DX text end addEventHandler("onClientRender", getRootElement(), DXdraw) function hudChanger2 () showPlayerHudComponent ( "money", true ) end addEventHandler( "onClientPlayerJoin", getRootElement(), hudChanger2 ) Updated !! Edited March 12, 2012 by Guest Link to comment
Kenix Posted March 12, 2012 Share Posted March 12, 2012 function DXdraw() --Variables sWidth, sHeight = guiGetScreenSize() moneycount=getPlayerMoney(getLocalPlayer()) money= 'Cash>' ..moneycount dxDrawText(tostring">tostring">tostring (money),sWidth-450,sHeight-500,sWidth-7,sHeight-57,tocolor(255,0,0,220),1.0,"pricedown","right","top",false,false,false) -- Money DX text end addEventHandler("onClientRender", getRootElement(), DXdraw) function hudChanger2 () showPlayerHudComponent ( "money", true ) showPlayerHudComponent ( "money", true) end addEventHandler( "onPlayerJoin", getRootElement(), hudChanger2 ) Your code wrong. Link to comment
Kenix Posted March 12, 2012 Share Posted March 12, 2012 onPlayerJoin is server side event Why define this in render? sWidth, sHeight = guiGetScreenSize() Link to comment
X-SHADOW Posted March 12, 2012 Share Posted March 12, 2012 i know Kenix but still work error or not its work perfectly Link to comment
Kenix Posted March 12, 2012 Share Posted March 12, 2012 local nW, nH = guiGetScreenSize( ) showPlayerHudComponent ( 'money', false ) addEventHandler( 'onClientRender', root, function( ) dxDrawText( string.format( "$%s", getPlayerMoney( localPlayer ) ), nW - 450, nH - 500, nW - 7, nH - 57, tocolor( 0,255,0,220 ), 1.0, 'pricedown', 'right', 'top', false, false, false ) -- Money DX text end ) Link to comment
X-SHADOW Posted March 12, 2012 Share Posted March 12, 2012 lol now i like you code better then mine i should wrok like you did i so mutch love it Link to comment
-RoCk-Alex Posted March 13, 2012 Author Share Posted March 13, 2012 local nW, nH = guiGetScreenSize( ) showPlayerHudComponent ( 'money', false ) addEventHandler( 'onClientRender', root, function( ) dxDrawText( string.format( "$%s", getPlayerMoney( localPlayer ) ), nW - 450, nH - 500, nW - 7, nH - 57, tocolor( 0,255,0,220 ), 1.0, 'pricedown', 'right', 'top', false, false, false ) -- Money DX text end ) Dbug :-hud.lua:1: attempt to call global 'guiGetScreenSize' (a nil value) Link to comment
-RoCk-Alex Posted March 13, 2012 Author Share Posted March 13, 2012 function DXdraw() --Variables sWidth, sHeight = guiGetScreenSize() moneycount=getPlayerMoney(getLocalPlayer()) money= 'Cash>' ..moneycount dxDrawText(tostring">tostring (money),sWidth-450,sHeight-500,sWidth-7,sHeight-57,tocolor(255,0,0,220),1.0,"pricedown","right","top",false,false,false) -- Money DX text end addEventHandler("onClientRender", getRootElement(), DXdraw) function hudChanger2 () showPlayerHudComponent ( "money", true ) end addEventHandler( "onClientPlayerJoin", getRootElement(), hudChanger2 ) Updated !! Your code too wrong Link to comment
-RoCk-Alex Posted March 13, 2012 Author Share Posted March 13, 2012 whenever i start the WarPanel that old hud starts showing i want that hud to be completely removed Link to comment
Kenix Posted March 13, 2012 Share Posted March 13, 2012 Dbug :-hud.lua:1: attempt to call global 'guiGetScreenSize' (a nil value) It's client side script. You should indicate it in meta.xml. https://wiki.multitheftauto.com/wiki/Meta.xml Link to comment
-RoCk-Alex Posted March 13, 2012 Author Share Posted March 13, 2012 Dbug :-hud.lua:1: attempt to call global 'guiGetScreenSize' (a nil value) It's client side script. You should indicate it in meta.xml. https://wiki.multitheftauto.com/wiki/Meta.xml I knew this was a client script and i had already indicated it in meta but still no use Link to comment
drk Posted March 13, 2012 Share Posted March 13, 2012 LOL Impossible. Show your meta.xml Link to comment
-RoCk-Alex Posted March 13, 2012 Author Share Posted March 13, 2012 LOL Impossible. Show your meta.xml Link to comment
Kenix Posted March 13, 2012 Share Posted March 13, 2012 LOL Impossible. Show your meta.xml Can you upload resource? 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