-RoCk-Alex Posted March 12, 2012 Posted March 12, 2012 is there any way of replacing not creating new DX just replacing...?
X-SHADOW Posted March 12, 2012 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
Kenix Posted March 12, 2012 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.
Kenix Posted March 12, 2012 Posted March 12, 2012 onPlayerJoin is server side event Why define this in render? sWidth, sHeight = guiGetScreenSize()
X-SHADOW Posted March 12, 2012 Posted March 12, 2012 i know Kenix but still work error or not its work perfectly
Kenix Posted March 12, 2012 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 )
X-SHADOW Posted March 12, 2012 Posted March 12, 2012 lol now i like you code better then mine i should wrok like you did i so mutch love it
-RoCk-Alex Posted March 13, 2012 Author 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)
-RoCk-Alex Posted March 13, 2012 Author 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
-RoCk-Alex Posted March 13, 2012 Author Posted March 13, 2012 whenever i start the WarPanel that old hud starts showing i want that hud to be completely removed
Kenix Posted March 13, 2012 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
-RoCk-Alex Posted March 13, 2012 Author 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
Kenix Posted March 13, 2012 Posted March 13, 2012 LOL Impossible. Show your meta.xml Can you upload resource?
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