Recommended Posts

On my client the dx-font working fine, but with another client the dx-font does not working.. 

Got this warning: WARNING: customchat\sourceC.Lua:164: Bad argument @ 'dxDrawText' [Expected dx-font at argument 8, got boolean]

the code:

local TwCen14s = dxCreateFont('TwCen.ttf', 10)

		dxDrawText("Chat: #ffFFff"..chat.input, sx / 2 - 450 - 255, sy / 2 - 356 - 60 + 25 * chat.maxShowedMessage, 450, 300, tocolor(255, 181, 64, 255), 1, TwCen14s,_,_,_,_,_,true)

what wrong?... how can i fix this problem?

Share this post


Link to post

This warning means your font was failed to load so it is returning 'false' value.

Make sure that you've added the font to your meta and/or make sure of the spelling of the file's name.

  • Like 1

Share this post


Link to post
7 minutes ago, HassoN said:

This warning means your font was failed to load so it is returning 'false' value.

Make sure that you've added the font to your meta and/or make sure of the spelling of the file's name.

i added the font to meta, and correct the file name.. 

Share this post


Link to post

@Tokio, make sure that you have enough memory to create a new font

To see if creation is likely to fail, use dxGetStatus. (When VideoMemoryFreeForMTA is zero, failure is guaranteed.)
(c) Wiki

You can check it using dxSetTestMode function or with the following code below

local st = dxGetStatus()
print("Memory: "..(st.VideoMemoryFreeForMTA).."/"..(st.VideoCardRAM).." MB.")

 

  • Like 1

Share this post


Link to post
Posted (edited)

 

For the cause of the issue, see post of @JeViCo

 

Fallback in case of failure:

local TwCen14s = dxCreateFont('TwCen.ttf', 10) or "default"

@Tokio

 

Also delete the file out of your mta cache folder. You may have it, but if you changed the destination of the file + in the meta but not in the script. You do have the font from the previous download, but everybody else does not. Files do not delete themselves after all. So check that as well, as

@HassoN

said.

 

Edited by IIYAMA
  • Like 1

Share this post


Link to post

Is your issue solved @Tokio?

Share this post


Link to post

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.