Jump to content

[HELP]Custom font crashes the game


Soapbosnia

Recommended Posts

Posted

Hello mta community,today i edited my hud a bit,and now when i create a custom font my game freezes and crashes,but before that the text dissapears,Heres the part of the code:

local zone = getZoneName (getElementPosition(getLocalPlayer()))
myfont = dxCreateFont("medusagothic.ttf",15)

dxDrawText(zone, sWidth*(-10/1024), sHeight*(725/768), tocolor(254, 254, 254, 255), myfont, "center", "top", false, false, true, true, false)

 

Posted
2 hours ago, Soapbosnia said:

Hello mta community,today i edited my hud a bit,and now when i create a custom font my game freezes and crashes,but before that the text dissapears,Heres the part of the code:


local zone = getZoneName (getElementPosition(getLocalPlayer()))
myfont = dxCreateFont("medusagothic.ttf",15)

dxDrawText(zone, sWidth*(-10/1024), sHeight*(725/768), tocolor(254, 254, 254, 255), myfont, "center", "top", false, false, true, true, false)

 

Use onClientRender

  • Moderators
Posted

Try to use an online tool to reconvert the font to True Type. It is probably containing some extra font information which MTA doesn't like.

Posted

dxCreateFont should not be part of the onClientReder call. If that is the case for you (you've given very little code, so we can't tell) that could lead to crashes.

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