Tokio Posted July 21, 2019 Share Posted July 21, 2019 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? Link to comment
HassoN Posted July 21, 2019 Share Posted July 21, 2019 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. 1 Link to comment
Tokio Posted July 21, 2019 Author Share Posted July 21, 2019 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.. Link to comment
JeViCo Posted July 21, 2019 Share Posted July 21, 2019 @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.") 1 Link to comment
Moderators IIYAMA Posted July 21, 2019 Moderators Share Posted July 21, 2019 (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 July 21, 2019 by IIYAMA 1 Link to comment
Moderators IIYAMA Posted July 24, 2019 Moderators Share Posted July 24, 2019 Is your issue solved @Tokio? 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