Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-03-27, 12:05


Dawciomax

Średniak .lua :)






Wiek: 23
Na forum: 3210 dni
Posty: 26
Nick w MP: Dawciomax

Piwa: 3

Respekt: 105,3
Respekt: 105,3

Witam mam problem ze zmienieniem czcionki w nametagach. Paczka PYS 3.0 Kto? co? pomo?e? Za pomoc daje :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-27, 12:37


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Opisz dok?adniej sw?j problem + daj kod

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-27, 13:21


Dawciomax

Średniak .lua :)






Wiek: 23
Na forum: 3210 dni
Posty: 26
Nick w MP: Dawciomax

Piwa: 3

Respekt: 105,3
Respekt: 105,3

Kod:


local screenSizeX, screenSizeY = guiGetScreenSize()

--local nametagFont = "default"
local nametagFont = dxCreateFont( "fonts/nametag_bakcup.ttf", 16 )
if not nametagFont then nametagFont = "default-bold" end
local vopisFont = dxCreateFont( "gowno.ttf", 18 )
if not vopisFont then vopisFont = "default-bold" end

local nametagScale = 0.6
local nametagScale2 = 0.58
local nametagAlpha = 180
local nametagColor =
{
r = 255,
g = 255,
b = 255
}
local img = dxCreateTexture("test.png")
-- Funkcja nametag?w graczy i pojazd?w
-- zazwyczaj s? dla u?atwienia wygl?du.
local tabela_auta = {}
local tabela_gracze= {}

function korona()
local rootx, rooty, rootz = getCameraMatrix()
for i, player in ipairs(getElementsByType("player",root,true)) do
if getElementDimension(localPlayer)==getElementDimension(player) and getElementInterior(localPlayer)==getElementInterior(player) then
if getElementAlpha(player) < 1 then
if not getElementData(localPlayer,"player:admin") == true then return end
end
local x,y,z = getPedBonePosition(player,6)
if x and y and z then
local distance = getDistanceBetweenPoints3D(rootx, rooty, rootz, x, y, z)
if(distance <= 22) then
if isLineOfSightClear( rootx,rooty,rootz, x,y,z, true, false, false, true, false, false, true,localPlayer ) then
if getElementData(player,"Ryjek") then
if(distance <= 12) then
dxDrawMaterialLine3D(x,y,z+1.25,x,y,z+0.35,img,1.1,white)
end
end
end
end
end
end
end
end
function num2hex(n) local i;local r="";for i=1,2 do r=r..string.char(n%256);n=math.floor(n/256);end return r;end
function str2hex(str)
local hex = ''
while #str > 0 do
local hb = num2hex(string.byte(str, 1, 1))
if #hb < 2 then hb = '0' .. hb end
hex = hex .. hb
str = string.sub(str, 2)
end
return hex
end

function nametag()
local rootx, rooty, rootz = getCameraMatrix()
for i,player in ipairs(getElementsByType("player")) do
if getElementDimension(localPlayer) == getElementDimension(player) and getElementInterior(localPlayer) == getElementInterior(player) then
local x,y,z = getPedBonePosition(player,6)
local sx, sy = getScreenFromWorldPosition(x, y, z+0.43)
local sxc,syc =getScreenFromWorldPosition(x, y, z+0.68)
if sx and sy and sxc and syc then
local distance = getDistanceBetweenPoints3D(rootx, rooty, rootz, x, y, z)
if getElementAlpha(player) < 1 and not getElementData(localPlayer,"player:admin") then
return end
if(distance <= 22) then
-- if isLineOfSightClear( rootx,rooty,rootz, x,y,z, true, false, false, false, false, false, true,localPlayer ) then
dxDrawText ((getPlayerName(player).."("..getElementData(player,"id")..")"):gsub("#%x%x%x%x%x%x",""),sx, sy, sx, sy,tocolor(0, 0, 56,255),nametagScale,nametagFont,"center","center",false,false,false,true,true,0,0,-50 )
dxDrawText (getPlayerName(player).."("..getElementData(player,"id")..")",sx+1, sy+1, sx+1, sy+1,tocolor(255,255,255,190),nametagScale,nametagFont,"center","center",false,false,false,true,true,0,0,-50 )
local level = getElementData(player, "player:level")
if not getElementData(player,"p:inv") then
if type(level) == "number" then
if level == 1 then
dxDrawText("[MODERATOR]", sxc, syc, sxc, syc, tocolor(0, 102, 0, 255), nametagScale2, nametagFont, "center", "center")
dxDrawText("[MODERATOR]", sxc+1, syc+1, sxc+1, syc+1, tocolor(0, 0, 0, 110), nametagScale2, nametagFont, "center", "center")
elseif level == 2 then
dxDrawText("[ADMINISTRATOR]", sxc, syc, sxc, syc, tocolor(255, 0, 0, 255), nametagScale2, nametagFont, "center", "center")
dxDrawText("[ADMINISTRATOR]", sxc+1, syc+1, sxc+1, syc+1, tocolor(0, 0, 0, 110), nametagScale2, nametagFont, "center", "center")
elseif level == 3 then
dxDrawText("[RCON]", sxc, syc, sxc, syc, tocolor(192,0,0, 255), nametagScale2, nametagFont, "center", "center")
dxDrawText("[RCON]", sxc+1, syc+1, sxc+1, syc+1, tocolor(0, 0, 0, 110), nametagScale2, nametagFont, "center", "center")
elseif level == 4 then
dxDrawText("[CEO]", sxc, syc, sxc, syc, tocolor(64,96,224, 255), nametagScale2, nametagFont, "center", "center")
dxDrawText("[CEO]", sxc+1, syc+1, sxc+1, syc+1, tocolor(0, 0, 0, 110), nametagScale2, nametagFont, "center", "center")
end
elseif type(level) == "table" then
dxDrawText("#ffffff["..level[2].."#ffffff]", sxc, syc, sxc, syc, tocolor(64,96,224, 255), nametagScale2+0.05, nametagFont, "center","center",false,false,false,true,true)
end
-- end
end
end
end
end
end
for i,vehicle in ipairs(getElementsByType("vehicle",root,true)) do
if isElement(vehicle) then
local x,y,z=getElementPosition(vehicle)
local sx,sy=getScreenFromWorldPosition(x,y,z)
if sx and sy then
local desc = getElementData(vehicle,"vehicle:desc")
if desc then
local distance=getDistanceBetweenPoints3D(rootx,rooty,rootz,x,y,z)
if getElementModel(vehicle) == 453 then
if distance <= 45 then
dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sx+2, sy+2, sx+2, sy+2, tocolor(255, 255, 255, 170), 0.65, vopisFont, "center", "center")
end
end
if getElementModel(vehicle) ~= 453 then
if distance <= 25 then
dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sx, sy, sx, sy, tocolor(0, 0, 0, 170), 0.64, vopisFont, "center", "center")
dxDrawText(desc:gsub("#%x%x%x%x%x%x",""), sx, sy, sx, sy, tocolor(255, 255, 255, 170), 0.65, vopisFont, "center", "center")
end
end
end
end
end
end
end

function inTable(tbl, item)
for key, value in pairs(tbl) do
if value == item then return key end
end
return false
end


function pobierzdane()
for i=1,#tabela_gracze do
if not isElement(tabela_gracze[i]) then table.remove(tabela_gracze,i) end
end
for i,player in ipairs(getElementsByType("player",root,true)) do
if player ~= localPlayer then
if inTable(tabela_gracze,player) then return end
table.insert(tabela_gracze,player)
end
end
for i=1,#tabela_auta do
if not isElement(tabela_auta[i]) then table.remove(tabela_auta,i) end
end
for i,vehicle in ipairs(getElementsByType("vehicle",root,true)) do
if inTable(tabela_auta,vehicle) then return end
table.insert(tabela_auta,vehicle)
end
end



addEventHandler("onClientResourceStart", resourceRoot, function()
for _,v in ipairs(getElementsByType("player")) do
setPlayerNametagShowing(v, false)
end
end)

addEventHandler("onClientPlayerSpawn", root, function()
setPlayerNametagShowing(source, false)
end)


addEvent("gui:start",true)
addEventHandler("gui:start",root,function()
--pobierzdane()
--setTimer(pobierzdane,3000,0)
addEventHandler("onClientPreRender", root, korona)
addEventHandler("onClientHUDRender", root, nametag)
triggerEvent("gui:start2",root)
end)
fileDelete("c_nametags.lua")


Chcia?bym zmieni? czcionke w nametagach

Podpis

Zapraszam na discord serwera Gang Wars:
https://discord.gg/kEsv55t
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-27, 13:45


Songo23







Wiek: 23
Na forum: 3047 dni
Posty: 37
Nick w MP: Songo23

Piwa: 665

Respekt: 45,3

Wrzucasz do folderu fonts swoj? czcionk? potem usuwasz star? i zmieniasz nazw? twojej czcionki na "nametag_bakcup.ttf"

Podpis
Aktualny projekt:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Dawciomax
Wysłany: 2018-03-27, 13:52


Dawciomax

Średniak .lua :)






Wiek: 23
Na forum: 3210 dni
Posty: 26
Nick w MP: Dawciomax

Piwa: 3

Respekt: 105,3
Respekt: 105,3

Dzieki dzia?a. leci piwko. Mo?na @LOCK

Podpis

Zapraszam na discord serwera Gang Wars:
https://discord.gg/kEsv55t
Postaw piwo autorowi tego posta
 

 
Tagi: tagi
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku