iFoReX Posted November 3, 2012 Posted November 3, 2012 why Dx Font Doesnt work ?, appear default font D: zKills = "-" Rank = "-" function hideIt(Kills,Ranks) zKills = Kills Rank = Ranks end addEvent("lolEvent",true) addEventHandler("lolEvent",root,hideIt) addEventHandler("onClientRender", root, function() local font_0 = dxCreateFont( ":guieditor/fonts/PetitFormalScript.ttf", 10 ) dxDrawText("#48FF00##2E2E2EZombie Kills : #48FF00#"..tostring(zKills).." \n#48FF00##2E2E2ERango : #48FF00#"..tostring(Rank), 437, 403, 547, 442, tocolor(0, 255, 251, 255), 1, font_0, "left", "center", false, false, true, true, false) end ) function onZombieWasted(_,killer) if (killer) then if (getElementType(killer) == "player") and (getElementType(source) == "ped") then if (getElementData(source, "zombie") == true) then local account = getPlayerAccount(killer) if account and not isGuestAccount(account) then local Kills = getAccountData(account,"Zombie kills") local Ranks = getAccountData(account,"Rango") triggerClientEvent("lolEvent",killer,Kills,Ranks) end end end end end addEventHandler("onPedWasted", root, onZombieWasted)
Castillo Posted November 3, 2012 Posted November 3, 2012 local font_0 = dxCreateFont( ":guieditor/fonts/PetitFormalScript.ttf", 10 ) That must go outside the onClientRender event.
iFoReX Posted November 3, 2012 Author Posted November 3, 2012 (edited) Doesnt appear the font * Edited November 3, 2012 by Guest
Castillo Posted November 3, 2012 Posted November 3, 2012 Are you sure that the font is valid and it's correctly created? P.S: Keep it english only on this section.
iFoReX Posted November 3, 2012 Author Posted November 3, 2012 yeh I used this font for a GUI And work 100% EDIT : In the Zombie Kills And in the Rank fields, Appear the Zombie Kills And The rank of other Player D:
Remp Posted November 4, 2012 Posted November 4, 2012 Is the guieditor resource running? When you are using relative file paths like that (file paths that start with :resourceName/...) to point to a font, the resource it references needs to be running for the path to work (in this case, guieditor). To avoid that just copy the font to your local resource folder and reference it there instead If that doesn't work, output the value of font_0 and see what it is
Renkon Posted November 4, 2012 Posted November 4, 2012 Sometimes dxCreateFont fails... I had to use GUI font instead.
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