Jump to content

guiCreateFont Error/Warning!


Recommended Posts

So i want to add for my own drift resource a custom font i have done this thing in other resources long time ago but now it doesnt work and i dont know why?

Also the font is installed on windows.

<meta>
    <script src="drift_C.lua" type="client"/>
    <script src="drift_s.lua" type="server"/>
    <map src="drift.map" dimension="2"></map>
    <file src="oceanicdrift.ttf"></file>
</meta>

Client Side

    local font = guiCreateFont("oceanicdrift.ttf",20)
    	driftlabel = guiCreateLabel(511, 859, 320, 81,"[ DRIFT: "..drift.."  X  "..counter.." ]", false)
    		guiSetFont(driftlabel,font)
    			guiLabelSetHorizontalAlign(driftlabel, "center", false)
    				guiLabelSetVerticalAlign(driftlabel, "center") 

Errors

[2023-03-08 22:01:25] WARNING: drift\drift_C.lua:25: Error creating font @ 'guiCreateFont' [oceanicdrift.ttf]
[2023-03-08 22:01:25] WARNING: drift\drift_C.lua:28: Bad argument @ 'guiSetFont' [Expected gui-font at argument 2, got boolean]

 

Edited by FlorinSzasz
Link to comment

make sure the font file and its extension are otf or ttf and make sure the file is not in a folder

17 minutes ago, FlorinSzasz said:

So i want to add for my own drift resource a custom font i have done this thing in other resources long time ago but now it doesnt work and i dont know why?

Also the font is installed on windows.

<meta>
    <script src="drift_C.lua" type="client"/>
    <script src="drift_s.lua" type="server"/>
    <map src="drift.map" dimension="2"></map>
    <file src="oceanicdrift.ttf"></file>
</meta>

Client Side

    local font = guiCreateFont("oceanicdrift.ttf",20)
    	driftlabel = guiCreateLabel(511, 859, 320, 81,"[ DRIFT: "..drift.."  X  "..counter.." ]", false)
    		guiSetFont(driftlabel,font)
    			guiLabelSetHorizontalAlign(driftlabel, "center", false)
    				guiLabelSetVerticalAlign(driftlabel, "center") 

Errors

[2023-03-08 22:01:25] WARNING: drift\drift_C.lua:25: Error creating font @ 'guiCreateFont' [oceanicdrift.ttf]
[2023-03-08 22:01:25] WARNING: drift\drift_C.lua:28: Bad argument @ 'guiSetFont' [Expected gui-font at argument 2, got boolean]

 

 

  • Like 1
Link to comment
44 minutes ago, Shady1 said:

so can you show client-side ?

Fixed

I had to increase my 2200g allocated video memory from 64 to 512mb

i had no FreeVideoMemoryForMTA, i tought MTA will use as much memory as it needs i have in BIOS 64mb but any game will take as much as it needs even if limit is 64 so when i dont play a game i dont waste ram as video memory. Well at least i have 16 GB of ram so ram wont be a problem.

  • Like 1
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...