Jump to content

[help]Problem dxDrawtext


SpoC^

Recommended Posts

hello friends, what is happening with my script, everything is fine.

more it just gets for a while on the screen then disappears

what's wrong?

in, /debugscript appears

[WARNING] client.lua bad argument

  
function DXINFO ( ) 
local largura = 350 
dxDrawImage(x*310, y*560, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
dxDrawImage(x*310, y*585, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
dxDrawImage(x*310, y*610, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
dxDrawImage(x*310, y*635, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
dxDrawImage(x*310, y*660, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
dxDrawImage(x*310, y*685, largura, 22, "info/fundo.png", 0,0,0, tocolor(0, 0, 0, 130)) 
  
  
local myFont = dxCreateFont( "info/font.ttf", 10 ) 
local Text = 150 
local mais = 4 
local alin = 4 
dxDrawBorderedText("ping: 00" ,x*310+alin, y*560+mais, x*310, y*40,tocolor(255, 255, 255, 100),1.0,myFont,"left","top",false,false, false) 
dxDrawText("#ffde00ping: #FFFFFF00" ,x*310+alin, y*560+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
  
dxDrawBorderedText("skin id: 00" ,x*310+alin, y*585+mais, x*310, y*40,tocolor(255, 255, 255,Text-100),1.0,myFont,"left","top",false,false,false) 
dxDrawText("#ffde00skin id: #FFFFFF00" ,x*310+alin, y*585+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
  
dxDrawBorderedText("hora real: 00:00:00   jogo: 00:00" ,x*310+alin, y*610+mais, x*310, y*40,tocolor(255, 255, 255,Text-100),1.0,myFont,"left","top",false,false,false) 
dxDrawText("#ffde00hora real: #FFFFFF00:00:00   #ffde00jogo: #FFFFFF00:00" ,x*310+alin, y*610+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
  
dxDrawBorderedText("nome do veiculo: nenhum" ,x*310+alin, y*635+mais, x*310, y*40,tocolor(255, 255, 255,Text-100),1.0,myFont,"left","top",false,false,false) 
dxDrawText("#ffde00nome do veiculo: #FFFFFFnenhum" ,x*310+alin, y*635+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
  
dxDrawBorderedText("jogadores online: 100/120" ,x*310+alin, y*660+mais, x*310, y*40,tocolor(255, 255, 255,Text-100),1.0,myFont,"left","top",false,false,false) 
dxDrawText("#ffde00jogadores online: #FFFFFF100/120" ,x*310+alin, y*660+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
  
dxDrawBorderedText("login: Test  senha: ******" ,x*310+alin, y*685+mais, x*310, y*40,tocolor(255, 255, 255,Text-100),1.0,myFont,"left","top",false,false,false) 
dxDrawText("#ffde00login: #FFFFFFTest  #ffde00senha: #FFFFFF******" ,x*310+alin, y*685+mais, x*310, y*40,tocolor(255, 255, 255,Text+100),1.0,myFont,"left","top",false,false,false,true) 
end 
  

Link to comment

You are creating the font on every render. This is not allowed. Create the font once outside of the render function, on resource start for example. Then use that font in your rendering function, that might be the issue you are facing here.

You should also make sure the font exists and works. Do not render unless the font works (or just use a fallback font).

Have you passed the font file into meta.xml?

Also, are you using onClientRender to render this stuff? If not, it will show up on your screen only for one frame.

If these did not help, then tell us your full error message.

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...