Jump to content

Dx Text


Mann56

Recommended Posts

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

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

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 by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...