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

Wysłany: 2019-01-13, 18:49


Ravolt1337







Wiek: 28
Na forum: 2712 dni
Posty: 15

Piwa: 76

Respekt: 21

Ostrzeżeń: 60%
Witam, mam taki problem, pr?buje uruchomi? HUD przez panel admina, lecz gdy klikam start zmienia status na running lecz hud si? nie pokazuje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 18:53


Query

SyndicateMTA






Wiek: 24
Na forum: 3071 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

mo?na kod ?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 18:54


Ravolt1337







Wiek: 28
Na forum: 2712 dni
Posty: 15

Piwa: 76

Respekt: 21

Ostrzeżeń: 60%
Kod:

--[[
Autor: FeiZzu
]]

local screenW, screenH = guiGetScreenSize()
font = dxCreateFont( "Img/font.ttf", 14 )
local tick = getTickCount()

local fps = 0
local tick = getTickCount()



function getCurrentFPS()
return fps
end

function updateFPS(msSinceLastFrame)
if fps == 0 then
fps = (1 / msSinceLastFrame) * 1000
end
if getTickCount()-tick > 1000 then
tick = getTickCount()
fps = (1 / msSinceLastFrame) * 1000
end
end
addEventHandler("onClientPreRender", root, updateFPS)
function hud()
if not getElementData(localPlayer,"player:sid") then return end -- Je?eli nie dzia?a to zmie? na player:uid
showPlayerHudComponent("all", false)
showPlayerHudComponent("radar", true)
showPlayerHudComponent("crosshair", true)
local nazwa = getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x","")
local godzina, minuty, dzien, miesiac, rok=getRealTime().hour, getRealTime().minute, getRealTime().monthday, getRealTime().month, getRealTime().year+1900
local hajs = getPlayerMoney(localPlayer)
local id = getElementData(localPlayer, "id")
local hp = getElementHealth(localPlayer)
local srp = getElementData(localPlayer, "player:srp") -- Je?eli nie dzia?a to zamie? na player:reputation
hajs = string.format("%d", hajs)

dxDrawImage(screenW * 0.7356, screenH * 0.0111, screenW * 0.2581, screenH * 0.1200, "hud.png", 0, 0, 0, tocolor(255, 255, 255, 255),false)
dxDrawText(""..nazwa.."", screenW * 0.7794, screenH * 0.0300, screenW * 0.8725, screenH * 0.0589, tocolor(255, 255, 255, 255), 1, font, "left", "center", false, false, false, true, false)
dxDrawImage(screenW * 0.7813, screenH * 0.0900, screenW * 0.0856*(hp/100), screenH * 0.0178, "hp.png", 0, 155, 255, tocolor(255,255,255,255), false);
dxDrawText(""..hajs.." $", screenW * 0.9125, screenH * 0.0311, screenW * 0.9894, screenH * 0.0589, tocolor(255, 255, 255, 255), 1, font, "center", "center", false, false, false, false, false)
dxDrawText(""..srp.."", screenW * 0.9125, screenH * 0.0867, screenW * 0.9894, screenH * 0.1122, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
dxDrawText(string.format("%02d:%02d",godzina, minuty), screenW * 0.0050, screenH * 0.9567, screenW * 0.0225, screenH * 0.9833, tocolor(255, 255, 255, 255), 1, font, "center", "center", false, false, false, false, false)
dxDrawText("FPS: "..math.floor(getCurrentFPS()), screenW * 0.0025, screenH * 0.8620, screenW * 0.0409, screenH * 1.0000, tocolor(255, 255, 255, 255), 0.85, "default-bold", "left", "bottom", false, false, false, false, false)
end

addEventHandler("onClientRender",root,function()
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
addEventHandler("onClientRender", root, hud)
end)

function lele()
if fileExists("c_hud.lua") then
fileDelete("c_hud.lua")
end
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), lele)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 19:00


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

U?yj tego:

--[[ 
AutorFeiZzu 
]] 

local screenWscreenH guiGetScreenSize() 
font dxCreateFont"Img/font.ttf"14 local tick getTickCount() 

local fps 0 
local tick getTickCount() 



function getCurrentFPS() 
return fps 
end 

function updateFPS(msSinceLastFrame) 
if fps == 0 then 
fps = (msSinceLastFrame) * 1000 
end 
if getTickCount()-tick 1000 then 
tick getTickCount() 
fps = (msSinceLastFrame) * 1000 
end 
end 
addEventHandler("onClientPreRender"rootupdateFPS) 

function hud() 
if not getElementData(localPlayer,"player:sid"then return end -- Je?eli nie dzia?a to zmiena player:uid 

local nazwa getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x",""local godzinaminutydzienmiesiacrok=getRealTime().hourgetRealTime().minutegetRealTime().monthdaygetRealTime().monthgetRealTime().year+1900 
local hajs getPlayerMoney(localPlayerlocal id getElementData(localPlayer"id"local hp getElementHealth(localPlayerlocal srp getElementData(localPlayer"player:srp") -- Je?eli nie dzia?a to zamiena player:reputation 
hajs string.format("%d"hajsdxDrawImage(screenW 0.7356screenH 0.0111screenW 0.2581screenH 0.1200"hud.png"000tocolor(255255255255),falsedxDrawText(""..nazwa..""screenW 0.7794screenH 0.0300screenW 0.8725screenH 0.0589tocolor(255255255255), 1font"left""center"falsefalsefalsetruefalsedxDrawImage(screenW 0.7813screenH 0.0900screenW 0.0856*(hp/100), screenH 0.0178"hp.png"0155255tocolor(255,255,255,255), false); 
dxDrawText(""..hajs.." $"screenW 0.9125screenH 0.0311screenW 0.9894screenH 0.0589tocolor(255255255255), 1font"center""center"falsefalsefalsefalsefalsedxDrawText(""..srp..""screenW 0.9125screenH 0.0867screenW 0.9894screenH 0.1122tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalsedxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.0050screenH 0.9567screenW 0.0225screenH 0.9833tocolor(255255255255), 1font"center""center"falsefalsefalsefalsefalsedxDrawText("FPS: "..math.floor(getCurrentFPS()), screenW 0.0025screenH 0.8620screenW 0.0409screenH 1.0000tocolor(255255255255), 0.85"default-bold""left""bottom"falsefalsefalsefalsefalseend 

addEventHandler("onClientRender"roothudaddEventHandler("onClientResourceStart"resourceRoot, function() 
showPlayerHudComponent("all"falseshowPlayerHudComponent("radar"trueshowPlayerHudComponent("crosshair"trueend


Upewnij si?, ?e posiadasz elementDat? "player:sid".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 19:09


Ravolt1337







Wiek: 28
Na forum: 2712 dni
Posty: 15

Piwa: 76

Respekt: 21

Ostrzeżeń: 60%
Teraz tylko znika hud z sa.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 19:18


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Masz elementdat? odpowiedni??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-13, 19:19


Ravolt1337







Wiek: 28
Na forum: 2712 dni
Posty: 15

Piwa: 76

Respekt: 21

Ostrzeżeń: 60%
Tak

[ Dodano: 2019-01-13, 19:45 ]
Poradzi?em sobie. Mo?na zamkn??.

Postaw piwo autorowi tego posta
 

 
Tagi: hud
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Hud 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