Tomaat Posted November 6, 2012 Posted November 6, 2012 Hey everyone, I have gotten a problem with my scipt, it wont load a text because of the font i use heres what i put in thescrip: local drawFont = dxCreateFont("draw.ttf", local drawFontCity = dxCreateFont("draw.ttf", 25) dxDrawText(lastCity, 1, scy-100+1, scx+1, scy-100+1, tocolor(0, 0, 0, cityDrawAlpha), 1, drawFontCity, "center", "top", false, false, true) dxDrawText(lastCity, 0, scy-100, scx, scy-100, tocolor(255, 255, 255, cityDrawAlpha), 1, drawFontCity, "center", "top", false, false, true) The error in /debugscript 3 is: Expected dx-font at argument 8, got nil whats wrong..? i did not make this script just please fix it, i think its creating a bit of lagg If its going to be an server default font its fine too, i need the font from the VehicleName when you enter one then please edit code#2 so i can put it in right away Regards, Tomaat
Castillo Posted November 6, 2012 Posted November 6, 2012 See if 'drawFontCity' returns something. P.S: Both dxCreateFont are outside the drawing event ( onClientRender ), right?
Anderl Posted November 6, 2012 Posted November 6, 2012 (edited) Are font files in the right path? Edited November 6, 2012 by Guest
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 im a noob... its the script https://community.multitheftauto.com/ind ... ls&id=5946 i removed the speedo stuff..
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 Are font files at the right path? Yes they are, i also tried moving them and making the path in the script different, same output
Anderl Posted November 6, 2012 Posted November 6, 2012 Fonts are in 'font' folder but you're trying to use font with path 'draw.ttf' and not 'fonts/draw.ttf'.
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 Fonts are in 'font' folder but you're trying to use font with path 'draw.ttf' and not 'fonts/draw.ttf'. Tryed that too, still errors Is there any way to change the font to a font thats already in mta ? like sa-gothic ?
Castillo Posted November 6, 2012 Posted November 6, 2012 Of course it is, here's a list of all valid fonts: "default": Tahoma"default-bold": Tahoma Bold "clear": Verdana "arial": Arial "sans": Microsoft Sans Serif "pricedown": Pricedown (GTA's theme text) "bankgothic": Bank Gothic Medium "diploma": Diploma Regular "beckett": Beckett Regular
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 Of course it is, here's a list of all valid fonts:"default": Tahoma"default-bold": Tahoma Bold "clear": Verdana "arial": Arial "sans": Microsoft Sans Serif "pricedown": Pricedown (GTA's theme text) "bankgothic": Bank Gothic Medium "diploma": Diploma Regular "beckett": Beckett Regular So how would it be ? i want it to be the pricedown will it be like : local drawFont = dxCreateFont("pricedown", or a whole change ?
Castillo Posted November 6, 2012 Posted November 6, 2012 dxCreateFont is only used to CREATE fonts, not to use current ones. dxDrawText(lastCity, 1, scy-100+1, scx+1, scy-100+1, tocolor(0, 0, 0, cityDrawAlpha), 1, "pricedown", "center", "top", false, false, true) dxDrawText(lastCity, 0, scy-100, scx, scy-100, tocolor(255, 255, 255, cityDrawAlpha), 1, "pricedown", "center", "top", false, false, true)
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 dxCreateFont is only used to CREATE fonts, not to use current ones. dxDrawText(lastCity, 1, scy-100+1, scx+1, scy-100+1, tocolor(0, 0, 0, cityDrawAlpha), 1, "pricedown", "center", "top", false, false, true) dxDrawText(lastCity, 0, scy-100, scx, scy-100, tocolor(255, 255, 255, cityDrawAlpha), 1, "pricedown", "center", "top", false, false, true) Oh My god, Finally!!! it worked Thanks so much! now, to change the font size i either have to do "pricedown, 25" or "pricedown",25 thats the last question Thanks so much already
Castillo Posted November 6, 2012 Posted November 6, 2012 You must change the scale of the text, is the argument before the font. dxDrawText(lastCity, 1, scy-100+1, scx+1, scy-100+1, tocolor(0, 0, 0, cityDrawAlpha), [color=#FF0000][size=8]1[/size][/color], "pricedown", "center", "top", false, false, true) dxDrawText(lastCity, 0, scy-100, scx, scy-100, tocolor(255, 255, 255, cityDrawAlpha), [color=#FF0000][size=8]1[/size][/color], "pricedown", "center", "top", false, false, true)
Tomaat Posted November 6, 2012 Author Posted November 6, 2012 You must change the scale of the text, is the argument before the font. dxDrawText(lastCity, 1, scy-100+1, scx+1, scy-100+1, tocolor(0, 0, 0, cityDrawAlpha), [color=#FF0000][size=8]1[/size][/color], "pricedown", "center", "top", false, false, true) dxDrawText(lastCity, 0, scy-100, scx, scy-100, tocolor(255, 255, 255, cityDrawAlpha), [color=#FF0000][size=8]1[/size][/color], "pricedown", "center", "top", false, false, true) Thank you so much! you helped me very much thanks for helping me fix it
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