Mann56 Posted March 27, 2015 Share Posted March 27, 2015 Hey guys, i am making a pizza job resource and need some help. I want to make Dx Text at the bottom right corner of screen that i can make no doubt but there i want to set no of pizzas a player has. So how can i change the text according to no.of pizzas? I mean if aplayer has 3 pizzas and takes 2 more how can i change the text from 3 to 5? Link to comment
WhoAmI Posted March 27, 2015 Share Posted March 27, 2015 Attach this text to variable, and just change it value. local text = 3 addEventHandler ( "onClientRender", root, function ( ) dxDrawText ( text, ... ) end ) addCommandHandler ( "change", function ( player, cmd, n ) if ( n ) then text = text + tonumber ( n ) end end ) Then if you type /change 3 it will add this number to your variable, so it will display "6". Link to comment
Mann56 Posted March 27, 2015 Author Share Posted March 27, 2015 (edited) Thanks for the code but i want that when i take 2 more pizza's it automatically changes the number and can you tell me what is on client render and tonumber i saw onClientRender in wiki but didnt understand it. Edited March 27, 2015 by Guest Link to comment
WhoAmI Posted March 27, 2015 Share Posted March 27, 2015 So somewhere in your function after adding pizza to player change the value of this variable. Link to comment
Mann56 Posted March 27, 2015 Author Share Posted March 27, 2015 Working Superb! Thanks bro! 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